Why should I use Core Data for my iPhone app?

Solution 1:

Core Data will mainly help in the auxiliary facets of the application - things like data persistence, presentation, etc. Some bullet points for your boss:

  • Core Data manages save and undo functionality for you. It has a persistent store, which tracks changes, and can be flushed to the disk automatically at any number of times (app close, etc.).
  • Core Data and related classes provide easy ways to get your entities into UITableViews, like NSFetchedResultsController.
  • Core Data abstracts away a lot of the messy things you'd otherwise have to deal with yourself, such as lists of objects, one-to-many or many-to-many relationships, or constraints on object attributes, into a single nice clean object-oriented interface.
  • Core Data comes with a nice graphical object model editor that can help you think through your object/entity design, and refine it as you go. (It also supports migration, so if you decide later that you want different attributes on your entities, you can do that relatively easily.)

Sure, the learning curve may be a bit steep, but the Apple examples are great to start with, and the Core Data documentation is very complete and helpful. Once you've got Core Data down, it'll be a breeze to build your app.

Solution 2:

To leverage CoreData, you'll need to know a fair amount of Cocoa technologies, concepts, and patterns. The learning curve is not really steep if you know these things. If it looks steep, I would avoid making it critical to your project, and then just learn during downtime, finally using it once you are comfortable with it. It is definitely not a beginner technology; you'll need a good programming foundation, including Cocoa specific technologies and concepts. A lot of people see it and think it will be easy for them, because they would, could get a lot for free. It's like a code generator, pretty close to useless to somebody who uses it to do just that (churn out code), rather than using it skillfully in response to the problem set.

Solution 3:

As far as the learning curve goes, I don't think it's as bad as you think. Using Apple's example classes and default CoreData project template, I was able to have a working CoreData app (fairly simple, but not trivial) up in a single afternoon, and it only took a couple days of playing around with the code before I had a really good understanding of what all the moving parts were (all while developing the rest of the app, so no time was wasted in tinkering).

CoreData works very...logically, I guess, and it's incredibly convenient. It saves you a lot of overhead, and I know it certainly saved me a lot of time writing that app. The short initial investment in learning the new technology was well worth it in the long run, now that I have such a powerful tool in my holster.