-refreshObject:mergeChanges: - need more transient property flexibility
-refreshObject:mergeChanges: - need more transient property flexibility
- Subject: -refreshObject:mergeChanges: - need more transient property flexibility
- From: Jim Correia <email@hidden>
- Date: Wed, 2 Nov 2005 16:01:46 -0500
The documentation says:
If flag is YES, this method does not affect any transient
properties; if flag is NO, transient properties are released.
The problem here is that if I don't want to lose local changes, I
have to say mergeChanges: YES.
But this doesn't release any transient properties. If I have a
transient property that is decoded/cached variant of a persistent
property, it is now stale.
I see a couple of solutions here.
- "Invent" my own willRefreshObject in which I toss the transient
properties.
- In every NSManagedObject subclass which I have this problem set a
flag (because there isn't much else you can do) in didTurnIntoFault
stating that the transient properties are stale and recompute them
the next time through.
#1 feels like I'm fighting the system. Surely I can't be the only one
whose bumped into this.
#2 feels like I'd be putting the same boilerplate code all over the
place, rather than having one general solution.
Does anyone have a cleaner solution, or better ideas?
Thanks,
Jim
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden