• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: How to get a NSButton (check box) state
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: How to get a NSButton (check box) state


  • Subject: Re: How to get a NSButton (check box) state
  • From: Martin Batholdy <email@hidden>
  • Date: Tue, 9 Jun 2009 01:09:12 +0200



in that case, you should use [sender state]

K


Thanks! That did it!


But what do I have to do if I want to set the state in the awakeFromNib?

I tried:

[launchOption setState:NSOnState];
[launchOption setState:1];


But the Button stays on "Off" state (like in Interface Builder set)...




thanks again!




On Mon, Jun 8, 2009 at 6:54 PM, Martin Batholdy <email@hidden > wrote:

WHEN are you looking at the state?


I look at the state in the method that is invoked by the NSButton (clicking on it).












Am 08.06.2009 um 23:58 schrieb KK:

Use [launchOption state] == NSOnState or [launchOption state] == NSOffState

Keita

On Mon, Jun 8, 2009 at 5:52 PM, Martin Batholdy <email@hidden > wrote:
Hi,


I have added a NSButton Check Box to a window.

Now I want to grab the state of this check box.

I added an IBOutlet to my header file and connected it with the check box in Interface Builder;

IBOutlet NSButton *launchOption;



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.




Can someone help me? thanks! _______________________________________________

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


_______________________________________________

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

----------------------------------------------------------------
Steve Bird
Culverson Software - Elegant software that is a pleasure to use.
www.Culverson.com                     (toll free) 1-877-676-8175



_______________________________________________

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


_______________________________________________

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


References: 
 >How to get a NSButton (check box) state (From: Martin Batholdy <email@hidden>)
 >Re: How to get a NSButton (check box) state (From: KK <email@hidden>)
 >Re: How to get a NSButton (check box) state (From: Martin Batholdy <email@hidden>)
 >Re: How to get a NSButton (check box) state (From: Steve Bird <email@hidden>)
 >Re: How to get a NSButton (check box) state (From: Martin Batholdy <email@hidden>)
 >Re: How to get a NSButton (check box) state (From: KK <email@hidden>)

  • Prev by Date: Re: How to get a NSButton (check box) state
  • Next by Date: Re: How to get a NSButton (check box) state
  • Previous by thread: Re: How to get a NSButton (check box) state
  • Next by thread: Re: How to get a NSButton (check box) state
  • Index(es):
    • Date
    • Thread