Changes

An iPhone OS Core Data Tutorial

2 bytes added, 18:11, 2 August 2010
Adding a View Controller
In order to add Core Data support to our application we had to choose the Window-based Application project template option when we started Xcode. As such, we now need to create our own view controller.
Within the main Xcode project window, right click on the ''Classes'' folder located in the ''Groups and Files'' panel. From the popup menu, select ''Add -> New File..''. In the new file window, select the ''UIViewController subclass'' icon and make sure that the ''UITableViewController subclass'' check box is not selectselected, but that the ''With XIB for user interface'' option is selected. Click Next, name the file ''coreDataViewController.m'' and make sure that the ''Also create coreDataViewController.h file'' option is selected before clicking on the Finish button.
Now that we have added the view controller class to the application we need to modify our app delegate to make this the root view controller. In the main Xcode project window, select the ''coreDataAppDelegate.h'' file and modify it to add references to our view controller: