Re: Beginner TableView Questions
Re: Beginner TableView Questions
- Subject: Re: Beginner TableView Questions
- From: Graham Cox <email@hidden>
- Date: Wed, 9 Apr 2008 22:07:19 +1000
If you implement the method:
- (void)tableView:(NSTableView *)aTableView setObjectValue:anObject
forTableColumn:(NSTableColumn *)aTableColumn row:(int)rowIndex
in your datasource it will be called when the checkbox changes state -
<anObject> will be the value of the checkbox as an NSNumber and
<aTableColumn>'s identifier will tell you which column it was part of,
and the rowIndex tells you the row.
------
S.O.S.
On 9 Apr 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
_______________________________________________
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
_______________________________________________
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