O'Reilly logo

Learning Mobile App Development: A Hands-on Guide to Building Apps with iOS and Android by Michael Eierman, Jakob Iversen

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Retrieve Data from Core Data

In the previous chapter, you saw how to save data to Core Data by inserting a Contact object into the managed object context. Retrieving data is similar, but instead of inserting objects, you will fetch them, and then specify some action to take on the retrieved objects. Listing 12.2 shows the changes you need to make in LMAContactsTableController.m to have the data show up from the database.

Listing 12.2 Retrieving Data from Core Data in LMAContactsTableController.m

#import "LMAContactsTableController.h"#import "LMAAppDelegate.h"                                                       //1#import "Contact.h"@interface LMAContactsTableController ()@endNSArray *contacts;LMAAppDelegate *appDelegate;                                                     //2 ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required