Tricky
Tricky

Reputation: 7165

Core data: Transient values dirty object

I'm using transient values to provide some data within my application. The trouble is, as soon as these values are calculated, it dirties my Managed Objects, reporting that a re-save is necessary.

Is there anyway to prevent transient values from marking an object as dirty if there are no actual changes to the object graph.

Thanks,

Upvotes: 3

Views: 730

Answers (2)

Andrew Ebling
Andrew Ebling

Reputation: 10283

Could you declare the fields as unmanaged properties in your data model class (i.e. they are defined in the source code, but not included in the data model)?

Upvotes: 1

John Gallagher
John Gallagher

Reputation: 6278

Check out this awesome post on transient properties in core data. It explains things far better than I can in this short space, plus I'm still getting my head around this!

This guy recommends using an IsValid flag and a Snapshot ivar to deal with this issue, I think.

Upvotes: 1

Related Questions