I'm using Core Data to store objects. I have a NSManagedObject
Person and a NSObject
Person. They both have the same attributes. The NSObject
has some methods.
Right now, I search Core Data for Bob. I then take that NSManagedObject
Bob and copy all the attributes to the NSObject
Bob and do what I need with it.
Does this make sense or should I create the needed methods in the NSManagedObject
instead? Can a NSManagedObject
be treated the same as a NSObject
?
An encouraged way is to build a category of your NSManagedObject subclass and implement your custom methods in this category. That way you can re-create your NSManagedObject subclass through Xcode if your schema changes and your category remains intact and unaffected.
Reference: e.g. Paul Hegarty's / Stanfords iOS courses on core data
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With