3
votes

Is it possible to define additional properties to a NSManagedObject subclass that are not defined within the Core Data Model? I have a series of additional properties that I do not want to include in the model.

I am able to save the NSManagedObject to the context just fine, but when I close the app then run a fetch after starting the app again, the NSManagedObject contains all null values...

Any ideas?

1

1 Answers

2
votes

If you want to save those values you have to put them into your model, otherwise you are fine to create them each time the value is accessed and wasn't created earlier.

Lazy loading style.

- (NSString *)name {
    if (!name) {
        name = ...
    }
    return name;
}