• 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
Prevent transient attributes to mark the database as dirty ?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Prevent transient attributes to mark the database as dirty ?


  • Subject: Prevent transient attributes to mark the database as dirty ?
  • From: Eric Morand <email@hidden>
  • Date: Wed, 31 May 2006 13:33:39 +0200

Hi List,

I'm encountering a strange issue. When I update a transient attribute, the database is marked as dirty (in other words : [myManagedObjectContext hasChanges] return YES).

Here is the method I use to set my transient property (named "balance") :


- (void)setBalance:(NSDecimalNumber *)value { if ( balance != value ) { [self willChangeValueForKey:@"balance"]; [balance release]; balance = [value retain]; [self didChangeValueForKey:@"balance"]; } }

Note that I NEED the willChange... and didChange... calls because I want the changes to this attribute to be notified to KVO observers. Note also that these two calls are responsible of the dirtiness of the database.

Is there a way to prevent this behavior, very problematic ?



Eric.
_______________________________________________
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


  • Prev by Date: Problem subclassing a NSCell in a NSTableView
  • Next by Date: Re: Use of weak reference in non-circular reference situation
  • Previous by thread: Re: Problem subclassing a NSCell in a NSTableView (more)
  • Next by thread: Re: some events are missing
  • Index(es):
    • Date
    • Thread