Re: Bindings & Reverting Properties
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