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

Reading value of a checkbox in an NSTable


  • Subject: Reading value of a checkbox in an NSTable
  • From: "Mike O'Connor" <email@hidden>
  • Date: Tue, 22 Jun 2004 14:49:41 -0400

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.

I have set in IB the target of the NSButtonCell to my action. When the user click a checkbox, the action does get called, but the sender is not the Cell, but rather the NSTableView. Why?

Since I only have the whole table, I have to find the cell that was clicked, so I use code like this:

unsigned theRow= [sender selectedRow];
NSTableColumn* theColumn= [sender tablecolumnWithIdentifier:myColumnID];
NSButtonCell* theCell= [theColumn dataCellForRow:theRow];

That all seems to work, but when I ask for [theCell state] or [theCell intValue] I always get 1. Why?

Thanks in advance! -Mike
_______________________________________________
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.


  • Follow-Ups:
    • Re: Reading value of a checkbox in an NSTable
      • From: Greg Robbins <email@hidden>
  • Prev by Date: Re: "Go to" widget in a TableView
  • Next by Date: How do I get a simple display pattern to work?
  • Previous by thread: Re: "Go to" widget in a TableView
  • Next by thread: Re: Reading value of a checkbox in an NSTable
  • Index(es):
    • Date
    • Thread