• 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: "Sean McBride" <email@hidden>
  • Date: Sat, 22 Aug 2009 03:04:06 -0400

Quincey Morris (email@hidden) on 2009-08-21 12:56 AM said:

>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

I prefer:

if (!!happy != !!newHappy)

since the !! reads as 'nop' and thus more clear (IHMO).

or

if ((bool)happy != (bool)newHappy)

(I hope Obj-C eventually gets rid of or fixes BOOL!)

Sean


_______________________________________________

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

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>)
 >Re: Bindings & Reverting Properties (From: Quincey Morris <email@hidden>)

  • Prev by Date: Re: NSAlternateKeyMask is not working
  • Next by Date: Re: Bindings & Reverting Properties
  • Previous by thread: Re: Bindings & Reverting Properties
  • Next by thread: Re: Bindings & Reverting Properties
  • Index(es):
    • Date
    • Thread