Saving Data to Core Data

With the data model and the managed object set up, it’s time to start saving the data from the user interface to Core Data.

But first, the user interface on the Contacts screen needs to be changed to add a Save button in the navigation bar. The code to do this is very similar to the Date controller. Open LMAContactsController.m and update the viewDidLoad: method to match Listing 11.7.

Listing 11.7 Adding the Save Button in LMAContactsController.m

- (void)viewDidLoad{    [super viewDidLoad];       // Do any additional setup after loading the view, typically from a nib.        _scrollView.contentSize = CGSizeMake(320,500);    UIBarButtonItem *saveButton =                   [[UIBarButtonItem ...

Get Learning Mobile App Development: A Hands-on Guide to Building Apps with iOS and Android now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.