I had a subclass of NSObject that acted as my app's main data model, with lots of properties and methods. I decided I wanted to use Core Data to saved this data, so I changed the subclass to be of NSManagedObject. I created the entity in the .xcdatamodeld and linked it with my NSManagedObject subclass. What I'm wondering is if it is okay to keep properties in my subclass that are not saved? For example, this class contains a NSOperationQueue property, but of course I don't want Core Data interacting with this property.
2 Answers
3
votes
When you automagically create (or re-create) an NSManagedObject from an Entity you lose anything else you had in that file. It is common for people to use categories to customize the logic for NSManagedObjects. It allows you to add customization to the default NSManagedObject without changing the code in that file!
Nice and clean.
This link may be helpful: http://developer.apple.com/library/ios/#documentation/cocoa/conceptual/objectivec/chapters/occategories.html