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

Re: Prevent transient attributes to mark the database as dirty ?


  • Subject: Re: Prevent transient attributes to mark the database as dirty ?
  • From: Fritz Anderson <email@hidden>
  • Date: Fri, 2 Jun 2006 10:42:21 -0500

On 31 May 2006, at 6:33 AM, Eric Morand wrote:

- (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.

I think you'll find that you don't need the {will,did}Change calls. The KVC mechanism brackets KVC set accessors with notifications to observers.


	-- F

_______________________________________________
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: Re: Newbie error
  • Next by Date: 2nd fullscreen window and keyboard input
  • Previous by thread: confusion in keycode
  • Next by thread: 2nd fullscreen window and keyboard input
  • Index(es):
    • Date
    • Thread