• 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 uncheck checkbox in an NSTableView
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: How to uncheck checkbox in an NSTableView


  • Subject: Re: How to uncheck checkbox in an NSTableView
  • From: Quincey Morris <email@hidden>
  • Date: Wed, 23 Dec 2009 12:59:55 -0800

On Dec 23, 2009, at 02:05, Lance Kwan wrote:

> I have troubles on unchecking a  checkbox in a table view.

What troubles? We can't help if we don't know.

>             if([buttonCell state] == 1)

Why are you using 0 and 1 for your 'if' tests, instead of NSOffState and NSOnState?

>             {
>                        NSLog(@"checkbox is check. Need to uncheck 1");
>                        NSLog(@"current state %d",[buttonCell state]);
>           	     [buttonCell setState:NSOffState];
>                        [buttonCell setNextState];

This code turns the checkbox off (setState:NSOffState) and then turns it back on again (setNextState). Seems like a bug.

>                        NSLog(@"new state %d",[buttonCell state]);
>
>             }

_______________________________________________

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 uncheck checkbox in an NSTableView (From: Lance Kwan <email@hidden>)

  • Prev by Date: Window Controllers
  • Next by Date: Re: There must be a better way
  • Previous by thread: How to uncheck checkbox in an NSTableView
  • Next by thread: Re: How to uncheck checkbox in an NSTableView
  • Index(es):
    • Date
    • Thread