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 (Cocoa-dev@lists.apple.com)

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to