• 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 set checkbox state in TableView columnheader
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: How to set checkbox state in TableView columnheader


  • Subject: Re: How to set checkbox state in TableView columnheader
  • From: "Zhang Li" <email@hidden>
  • Date: Fri, 9 Oct 2009 15:44:00 +0800

NSButtonCell inherits from NSActionCell and NSCell. (See 2nd line of the NSButtonCell documentation). Click the links. Now, try -[NSCell setState:], which will probably work, and -[NSActionCell setObjectValue:], which might work.

I called [cell setObjectValue:[NSNumber numberWithInt:1]] before [cell release], the checkbox still shows unchecked.
But when I clicked table column, from debug output of below, both buttonStateBefore & buttonStateAfter are 1, that means checkbox is already set to on state, then why the checkbox picture doesn't reflect the state change?


- (void)tableView: (NSTableView *)tableView didClickTableColumn:(NSTableColumn *)tableColumn
{
NSLog(@"buttonStateBefore:%@", [[tableColumn headerCell] objectValue]);
[[tableColumn headerCell] setObjectValue:[NSNumber numberWithInt:1]];
NSLog(@"buttonStateAfter:%@", [[tableColumn headerCell] objectValue]);
}


Thanks,
Zhang Li



_______________________________________________

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 set checkbox state in TableView columnheader (From: "Zhang Li" <email@hidden>)
 >Re: How to set checkbox state in TableView columnheader (From: Jerry Krinock <email@hidden>)
 >Re: How to set checkbox state in TableView columnheader (From: "Zhang Li" <email@hidden>)

  • Prev by Date: Re: How to set checkbox state in TableView columnheader
  • Next by Date: Instance variables: access directly vs. getter / setter
  • Previous by thread: Re: How to set checkbox state in TableView columnheader
  • Next by thread: Re: How to set checkbox state in TableView columnheader
  • Index(es):
    • Date
    • Thread