• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
-refreshObject:mergeChanges: - need more transient property flexibility
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

-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
  • Follow-Ups:
    • Re: -refreshObject:mergeChanges: - need more transient property flexibility
      • From: mmalcolm crawford <email@hidden>
  • Prev by Date: Two threads two autorelease pools one object?
  • Next by Date: Re: fileExistsAtPath:isDirectory - BROKEN?
  • Previous by thread: Re: Two threads two autorelease pools one object?
  • Next by thread: Re: -refreshObject:mergeChanges: - need more transient property flexibility
  • Index(es):
    • Date
    • Thread