Re: Beginner TableView Questions
Re: Beginner TableView Questions
- Subject: Re: Beginner TableView Questions
- From: Ron Fleckner <email@hidden>
- Date: Wed, 9 Apr 2008 20:29:41 +1000
On 09/04/2008, at 5:43 PM, Peter Zegelin wrote:
I have an NSTableView with several columns of checkboxes. Each of
my columns has an identifier. I also have an NSObjectController
subclass acting as both data source and delegate. I can populate
the table with some data.
However I am stuck on how to know when a checkbox has been clicked
on so I can update my model. I would prefer to get the info as a
row number in a particular column if that is possible.
I actually created an 'update' method in my controller and linked a
checkbox to this and can receive the message when a checkbox is
clicked but the sender doesn't have any obvious column/row info so
I'm pretty sure this isn't the way to go. Also I don't want to use
bindings as the data is C++;
- (void)update:(id) sender{
}
Any help greatly appreciated,
thanks
Peter
You could try to get a ref to the table view by asking sender about
it's superview. Or you could just get the selected row from the
tableview itself. Presumably you have a reference to it. When the
button is clicked, the row it's in will be selected. Not sure, but I
think you can get the column info from the tableview as well.
HTH,
Ron
_______________________________________________
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