views:

1156

answers:

1

Is it the generated files from the data model that matters more or is the actual xcdatamodel file?

And is it possible to change the ownership property from 'retain' to 'copy' for the files that are autogenerated from the xcdatamodel class?

A: 

The xcdatamodel file is what CoreData will use to manage objects.

The generated objects act as handy containers that support the KVO stuff CD needs to keep track of changes. I don't think it would care if you mark properties as copy instead of retain...

Kendall Helmstetter Gelner
Of course, there's no guarantee that the CD-injected getter/setter implementations will do a copy for you.
tc.
That's an excellent point, and in fact now I am quite sure CoreData will just do what it wants since all properties in any CoreData generated classes are @dynamic... and of course CoreData builds the whole class dynamically anyway. To ensure you do a copy you could set the value and then refresh the model or object.
Kendall Helmstetter Gelner