• 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: Making a bound view re-read its value
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Making a bound view re-read its value


  • Subject: Re: Making a bound view re-read its value
  • From: Quincey Morris <email@hidden>
  • Date: Fri, 15 Aug 2008 11:02:06 -0700

On Aug 15, 2008, at 10:23, Adam R. Maxwell wrote:

Sending empty willChange/didChange messages is not a good idea:

http://www.cocoabuilder.com/archive/message/cocoa/2008/5/18/207038

Except that the idea of "non-empty" willChange/didChange messages doesn't cohere. The following is a perfectly legal setter:


- (void) setX: (NSInteger) newX {
	[self willChangeValueForKey:@"x"];
	iVarX = newX;
	[self didChangeValueForKey:@"x"];
}

When this is called with newX == iVarX, it doesn't do anything except call willChange/didChange, so it's "empty" in that case, if "empty" had any meaning here. If there was some problem with "empty" setters, that scenario would fail. Does setting a property to its current value fail?

It may well be different for Core Data property setters, though.

IAC, Marcus's alternative is to do this:

	object.temperature = object.temperature;

instead of this:

	[object willChangeValueForKey:@"temperature"];
	[object didChangeValueForKey:@"temperature"];

_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


  • Follow-Ups:
    • Re: Making a bound view re-read its value
      • From: "Michael Ash" <email@hidden>
    • Re: Making a bound view re-read its value
      • From: Markus Spoettl <email@hidden>
References: 
 >Making a bound view re-read its value (From: Markus Spoettl <email@hidden>)
 >Re: Making a bound view re-read its value (From: Negm-Awad Amin <email@hidden>)
 >Re: Making a bound view re-read its value (From: Markus Spoettl <email@hidden>)
 >Re: Making a bound view re-read its value (From: "Adam R. Maxwell" <email@hidden>)

  • Prev by Date: RE: Threading problem using AsyncSocket
  • Next by Date: Re: Animating a view along a path
  • Previous by thread: Re: Making a bound view re-read its value
  • Next by thread: Re: Making a bound view re-read its value
  • Index(es):
    • Date
    • Thread