core data

Core Data BLOB Management with Virtual Properties

Keeping BLOBs (Binary Large OBjects) in your Core Data store is generally a bad idea. If you happen to have a large graph of managed objects in your application, it becomes increasingly difficult to manage memory. Faulting can help to a certain extent, but I’ve found it very difficult to successfully manage memory by faulting […]

Populating The Core Data Store With Predefined Data

In my previous article, I’ve shown you a way to turn your managed objects into a dictionary, and vice-versa. In this article, we’ll use that code to populate the Core Data store with data stored in plain-text files in your project’s bundle. We’ll use JSON for representing our objects, but you can generally use any […]

Serializing (Archiving/Unarchiving) an NSManagedObject Graph

Since the NSManagedObject class doesn’t conform to the NSCopying protocol, there seems to be no easy way to archive a bunch of interrelated managed objects. Once you archive a part of your object graph, you could use the serialized representation for various purposes – sending it over a network, making backups, etc. The way I […]