• 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: Reading value of a checkbox in an NSTable
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Reading value of a checkbox in an NSTable


  • Subject: Re: Reading value of a checkbox in an NSTable
  • From: Greg Robbins <email@hidden>
  • Date: Tue, 22 Jun 2004 12:50:26 -0700

At 2:49 PM -0400 6/22/04, Mike O'Connor wrote:
I've got an NSTable with a few columns, and in one column I've placed an NSButtonCell there with IB. This cell is set to be a checkbox. When the user clicks a checkbox, I want to call an IBAction so I can read the new state and set some data appropriately.

There's only one button used for all rows of the table's column, so it's not appropriate to treat it as if there were different instances of the button for each row.

Instead of relying on an action for the button, just handle clicks to it in the data source's setObjectValue method,

- (void)tableView:(NSTableView *)aTableView
setObjectValue:(id)theValue
forTableColumn:(NSTableColumn *)aTableColumn
row:(int)rowIndex;

where theValue will tell you the new setting for the checkbox after the user clicks it.

Greg Robbins
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.


References: 
 >Reading value of a checkbox in an NSTable (From: "Mike O'Connor" <email@hidden>)

  • Prev by Date: NSTask Question
  • Next by Date: Re: Value Transformers and MVC ...
  • Previous by thread: Reading value of a checkbox in an NSTable
  • Next by thread: How do I get a simple display pattern to work?
  • Index(es):
    • Date
    • Thread