Text replacement - "<table border="0" cellspacing="0">" to "<table border="0" cellspacing="0" width="100%">"
In the previous chapter, entitled [[Working with iOS 4 iPhone Databases using Core Data]], an overview of the Core Data stack was provided, together with details of how to write code to implement data persistence using this infrastructure. In this chapter we will continue to look at Core Data in the form of a step by step tutorial that implements data persistence using Core Data in an iOS 4 iPhone application.
Select the coreData entry from the top of the Groups & Files list to display all the files in the project and scroll down to MainWindow.xib. Double click on this file to load it into the Interface Builder tool. From the Library window, drag and drop a View Controller object onto the MainWindow.xib window. Once released, the new view controller should appear beneath the existing objects as illustrated in the following figure:
With the actions and outlets defined, now is a good time to design the user interface and establish the connections. To load the Interface Builder tool, double click on the coreDataViewController.xib file. The user interface and corresponding connections used in this tutorial are the same as those in previous data persistence chapters. The completed view should, once again, appear as follows:
[[Image:iphone_core_data_tutorial_layout.jpg|The view layout of the iPhone Core data example application]]
[[Image:ios_4_iphone_core_data_app.jpg|An iOS 4 iPhone Core Data Example App running]]