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