November 2013
Intermediate to advanced
576 pages
19h 3m
English
The object used to fetch managed objects in Core Data is called NSFetchRequest. Refer to ICFFriendChooserViewController in the sample app. This view controller displays the friends set up in Core Data and allows the user to select a friend to lend a movie to (see Figure 13.6).
Figure 13.6 Sample App: Friend Chooser.
To get the list of friends to display, the view controller performs a standard fetch request when the view controller has loaded. The first step is to create an instance of NSFetchRequest and associate the entity to be fetched with the fetch request:
NSManagedObjectContext ...
Read now
Unlock full access