Re: NSNumber numberWithBool
Re: NSNumber numberWithBool
- Subject: Re: NSNumber numberWithBool
- From: "Clark Cox" <email@hidden>
- Date: Mon, 29 Jan 2007 09:27:46 -0500
On 1/29/07, mark hill <email@hidden> wrote:
I have declared a NSMutableDictionary thus:
NSArray * keys = [NSArray arrayWithObjects:
@"name", @"hidden", nil];
NSArray * values = [NSArray
arrayWithObjects: @"Object Name", [NSNumber
numberWithBool:false], nil];
properties = [[NSMutableDictionary alloc]
initWithObjects: values forKeys: keys];
But cannot access the "hidden" BOOL value, it refers
to IB checkbox binding.
NSLog(@"%@", [properties valueForKeyPath: @"hidden"]);
returns 0 or 1 as expected, but I can't seem to
implement a conditional based on this!
BOOL flag = [[properties valueForKeyPath: @"hidden"] boolValue];
if(flag)
{
...
}
--
Clark S. Cox III
email@hidden
_______________________________________________
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