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

Chapter 12. Core Data > Creating and Saving Data Using Core Data

recipe 12.4. Creating and Saving Data Using Core Data

12.4.1. Problem

You want to create a new managed object and insert it into the managed object context.

12.4.2. Solution

Follow the instructions in Section 12.2 and Section 12.3. Now you can use the insertNewObjectForEntityForName:inManagedObjectContext: class method of NSEntityDescription to create a new object of a type specified by the first parameter of this method. Once the new entity (the managed object) is created, you can modify it by changing its properties. After you are done, save your managed object context using the save: instance method of the managed object context.


  

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


  
  • Safari Books Online
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • DownloadDownload
  • PrintPrint