CheckBox Control. Application is hangs

Discussion in 'Mac Programming' started by Sergio10, Apr 1, 2009.

  1. macrumors regular

    Joined:
    Oct 3, 2007
    #1
    Hi I have next event which binds to check box:
    Code:
    - (IBAction)clickCheckBox:(id)sender
    {
    	if([sender isSelected] == YES)
    	{
    		[position setStringValue: @"isSelected"];
    		_isChecked = YES;
    	}
    	else
    	{
    		[position setStringValue: @"notSelected"];
    		_isChecked = NO;
    	}
    }
    
    On debug, this code is hangs(at first line). Why? How to verify checkbox control it is checked?

    Thanks,
    Sergio
     
  2. Moderator emeritus

    kainjow

    Joined:
    Jun 15, 2000
    #2
    isSelected is not a method that NSButton knows. Use state:
    Code:
    if ([sender state] == NSOnState)
     

Share This Page