As always, the master view controller handles the list of items that are shown by the detail view controller. It also handles reading and writing the items. The code is a combination of standard Master-Detail Application code from the template and iCloud-specific additions. Listing 14.2 shows MasterViewController.h

Listing 14.2 MasterViewController.h

#import <UIKit/UIKit.h>@class JFDetailViewController;@interface JFMasterViewController : UITableViewController@property (strong, nonatomic) JFDetailViewController *detailViewController;@property (weak, nonatomic) IBOutlet UIBarButtonItem *addButton;         //1@end

1    This is the add button on the master view controller. When you create your ...

Get Learning iCloud Data Management: A Hands-On Guide to Structuring Data for iOS and OS X 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.