Re: How to get a NSButton (check box) state
Re: How to get a NSButton (check box) state
- Subject: Re: How to get a NSButton (check box) state
- From: Greg Guerin <email@hidden>
- Date: Mon, 8 Jun 2009 15:14:51 -0700
Martin Batholdy wrote:
Now I want to test the state via;
if([launchOption state] == 0) { NSLog(@"A"); }
else if([launchOption state] == 1) { NSLog(@"B"); }
The answer of this if / else statement is always A and I don't
understand why.
In addition to what was said about using NSOnState and NSOffState,
you should confirm that launchOption actually contains a non-nil object.
Think about what will happen in your code if launchOption is nil.
Can you send messages to nil? What happens when you do? What value,
if any, is returned?
-- GG
_______________________________________________
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