• 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: Sorted NSTableView's selectedRow
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


References: 
 >Sorted NSTableView's selectedRow (From: "Adam Preble" <email@hidden>)

  • Prev by Date: Re: Getting a list of files/folders in a folder/drive
  • Next by Date: Re: iTunes Database
  • Previous by thread: Sorted NSTableView's selectedRow
  • Next by thread: Crash from deep in quartz
  • Index(es):
    • Date
    • Thread