Re: Negate a boolean NSSNumber
Re: Negate a boolean NSSNumber
- Subject: Re: Negate a boolean NSSNumber
- From: Scott Anguish <email@hidden>
- Date: Fri, 2 Mar 2007 18:28:53 -0500
On Mar 2, 2007, at 6:24 PM, Martin wrote:
Hi,
What's the best way to negate a boolean wrapped up in an NSNumber ?
Something like :
NSNumber *b = [NSNumber numberWithBool:NO];
[b negate]; // so that [b boolValue] == YES
NSNumber isn't mutable, so you'd need to make a new one
NSNumber *bNegative = [NSNumber numberWithBool:![b boolValue]];
_______________________________________________
Cocoa-dev mailing list (email@hidden)
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