Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>There exist Xcode templates for Core Data-based applications; these are a great start to getting Core Data off the ground. However, it sounds like you want to integrate Core Data into your existing app, so you'll need to...</p> <ul> <li>Add three main Core Data objects: the managed object context (MOC), the managed object model (MOM), and the persistent store coordinator (PSC). These need to be accessible wherever you want Core Data available, so either in your app delegate or, more preferably, in the controller or data source for your table view.</li> <li>Create a MOM in Xcode. This will be a file of type .xcdatamodel, and it's an object graph that defines all the Core Data entities you want in your app.</li> <li>Use NSFetchedResultsController (as suggested by Louis Gerbarg) to get data out of Core Data and display it into your table view.</li> <li>Add code in your existing RSS-fetching-and-parsing routines to store new Core Data objects back into the store, when appropriate.</li> </ul> <p>A good way to start is just to create a new Core Data application and play around with it a bit; you can also look at Apple's fantastic resources on the subject, like the <a href="http://developer.apple.com/iphone/library/documentation/Cocoa/Conceptual/CoreData/cdProgrammingGuide.html" rel="nofollow noreferrer">Core Data Programming Guide</a> and the sample apps <a href="http://developer.apple.com/iphone/library/samplecode/iPhoneCoreDataRecipes/" rel="nofollow noreferrer">Recipes</a> and <a href="http://developer.apple.com/iphone/library/samplecode/Locations/index.html#//apple_ref/doc/uid/DTS40008406" rel="nofollow noreferrer">Locations</a>. (Developer registration may be required.)</p> <p>One last thing to note is that for the most part, a lot of the Core Data code you need to add can be ripped straight out of one of the Xcode template apps and pasted into your program (this holds especially true for the accessors for the three Core Data objects you need). Be careful not to use code you don't understand, though.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload