Re: Sorted NSTableView's selectedRow
Re: Sorted NSTableView's selectedRow
- Subject: Re: Sorted NSTableView's selectedRow
- From: Jim Correia <email@hidden>
- Date: Fri, 5 Jan 2007 09:10:58 -0500
On Jan 5, 2007, at 8:47 AM, Adam Preble wrote:
I'm have a project with an NSTableView whose content is set through
bindings. In one of my methods I want to obtain the object selected
in the table and send messages to it. As the objects are kept in an
NSArray, the only approach in getting the object I can see is:
[array objectAtIndex: [tableView selectedRow]]
Where does "array" come from here?
If you want to operate on the selected items in the table view, don't
talk to the array in the model directly, go through the controller.
The following methods on NSArrayController are relevant:
-arrangedObjects
-selectionIndexes
-selectionIndex
-selectedObjects
Jim
_______________________________________________
Cocoa-dev mailing list (email@hidden)
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