16Core Data

When deciding between approaches to saving and loading for iOS applications, the first question is typically Local or remote? If you want to save data to a remote server, this is typically done with a web service. Web services are covered in Chapter 25, so let’s assume that you want to store data locally. The next question is typically Archiving or Core Data?

At the moment, Homepwner uses keyed archiving to save item data to the filesystem. The biggest drawback to archiving is its all-or-nothing nature: to access anything in the archive, you must unarchive the entire file; to save any changes, you must rewrite the entire file. Core Data, on the other hand, can fetch a small subset of the stored objects. And if you change any ...

Get iOS Programming: The Big Nerd Ranch Guide now with the O’Reilly learning platform.

O’Reilly members experience live online training, plus books, videos, and digital content from nearly 200 publishers.