Can I add standard properties to an NSManagedObject. I don't expect these objects to be saved, but I would like them to persist for the lifetime that the application is running.
Can I add a getter and setter backed with an ivar?
In this case "transient properties" are commonly used. You declare them in your Core Data Model like your other Entity properties but flag them as "transient" in the data model inspector. They are part of your Core Data model, but not persisted!
Yes, you can add your own properties and methods to a class derived from NSManagedObject. I do this all the time. You can declare the properties @dynamic (if using Core Data), or simply @synthesize them.
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