Free Trial

Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.


  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • DownloadDownload
  • PrintPrint
Share this Page URL
Help

13. Core Data > 13.2. Generating Class Files for Core Data Entities

13.2. Generating Class Files for Core Data Entities

Problem

You followed the instructions in Recipe 13.1 and you want to know how to create code based on your object model.

Solution

Follow these steps:

  1. In Xcode, find the file with the xcdatamodel extension that was created for your application when you created the application itself in Xcode. Click on the file, and you should see the editor on the righthand side of the Xcode window.

  2. Select the Person entity that we created earlier (see Recipe 13.1).

  3. Select File?New File in Xcode.

  4. In the New File dialog, make sure you have selected iOS as the main category and Core Data as the subcategory. Then choose the NSManagedObject subclass item from the righthand side of the dialog and press Next, as shown in Figure 13-11.


  

You are currently reading a PREVIEW of this book.

                                                                                        

Get instant access to over
$1 million worth of books and videos.

  

Start a Free Trial