Results 1 to 2 of 2

Thread: [help]how to dealing with checkbox in Xcode

  1. #1

    Member Since
    Feb 24, 2009
    [help]how to dealing with checkbox in Xcode
    hello everyone,

    i search in deferent book about how to dealing with the checkbox but i don`t understood it

    so can anyone help me.. and tell me how to dealing with it..?
    how to know if it true or false..?

    and please if you have a good website tutorial send the link to me or write it here..

  2. #2

    Member Since
    Jul 11, 2009
    Well, the checkbox in Interface Builder is really just a type of NSButton, and in Xcode's documentation, it tells us a button can have either two or three states, On (true), Off (false) and sometimes Mixed.

    Now, how do we find out what state the button is in? First, create an connection between your code and your NIB with this.
    IBOutlet NSButton *buttonName;
    Then, in your code, you can use a simple if statement to fine out what state the button is in, like so.

    if ( [button state] == NSOnState ) {
        //The button is checked...
    } else {
        //The button is not checked...
    You can see a very simple example in the attached project. Open the Console and when you press Update, you'll see if the button is on or not.
    Attached Files Attached Files

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Odd checkbox next to my dock
    By zwpeters in forum macOS - Operating System
    Replies: 4
    Last Post: 04-05-2013, 02:37 AM
  2. Numbers printing checkbox items
    By Twinjayhawks in forum iPad Hardware and Accessories
    Replies: 0
    Last Post: 11-29-2012, 09:53 PM
  3. Sound Checkbox Grayed Out
    By cbreid in forum macOS - Operating System
    Replies: 13
    Last Post: 10-30-2012, 03:08 PM
  4. Xcode stopped letting me run Xcode app on iPad
    By ildsarria in forum iOS Development
    Replies: 1
    Last Post: 11-09-2011, 04:15 PM
  5. Checkbox question
    By Guitarist in forum iPod Hardware and Accessories
    Replies: 4
    Last Post: 10-18-2006, 08:41 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts