• 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: Bindings & Reverting Properties
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Bindings & Reverting Properties


  • Subject: Re: Bindings & Reverting Properties
  • From: Quincey Morris <email@hidden>
  • Date: Fri, 21 Aug 2009 21:56:52 -0700

On Aug 21, 2009, at 21:27, Ken Thomases wrote:

Except that there's no reason to believe that that the old value of happy is the opposite of newHappy. It's perfectly possible for setHappy: to be passed he current value.

What's this mania everyone has lately about being *right* in their posts. I'm sick of it, I tell you, sick! :)


Actually, I took the "revert" code to be merely iconic for something a lot more complicated, so I didn't bother, you know, reading it. And since we're comparing comparing BOOLs, I'll contribute my preferred version:

- (void)setHappy: (BOOL)newHappy
{
	if (!happy != !newHappy) // Another way of safely comparing BOOLs
	{
		...
	}
}

which is a bit shorter and more clearly a comparison.


_______________________________________________

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: Bindings & Reverting Properties
      • From: "Sean McBride" <email@hidden>
References: 
 >Bindings & Reverting Properties (From: Dave Keck <email@hidden>)
 >Re: Bindings & Reverting Properties (From: Quincey Morris <email@hidden>)
 >Re: Bindings & Reverting Properties (From: Ken Thomases <email@hidden>)

  • Prev by Date: Re: Bindings & Reverting Properties
  • Next by Date: Re: Table view with multiple columns
  • Previous by thread: Re: Bindings & Reverting Properties
  • Next by thread: Re: Bindings & Reverting Properties
  • Index(es):
    • Date
    • Thread