• 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: Beginner TableView Questions
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


References: 
 >Beginner TableView Questions (From: Peter Zegelin <email@hidden>)

  • Prev by Date: Re: Text with translucent Background
  • Next by Date: Layer-Hosting View on NSTabViewItem and switching Pages
  • Previous by thread: Re: Beginner TableView Questions
  • Next by thread: Re: Beginner TableView Questions
  • Index(es):
    • Date
    • Thread