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

Re: NSTableView


  • Subject: Re: NSTableView
  • From: Steven Riggs <email@hidden>
  • Date: Wed, 05 Nov 2008 00:21:15 -0500

Thanks for the clarification Graham. It seems that retrieving data ordered (rows and columns) the same as the view is a common task. Apples solutions are pretty well thought out and encompassing so I was surprised there was not an easier way to get it. There's nothing worse than coding something yourself only to discover soon after that there is a standard method to do the job. The dataCellForRow: sent me on a wild goose chase too. It was still pretty easy though once I figured out how to correlate the view arrangement with the array data.

Steven Riggs

On Nov 4, 2008, at 11:57 PM, Graham Cox wrote:


On 5 Nov 2008, at 3:46 pm, Steven Riggs wrote:

This feels like a workaround for not being able to get the data straight from the table view


Can I just point out something? NSTableView is a view - the clue is in the name. Thus interrogating it for data is a little silly, no?

You should always go back to the source (i.e. the data model) when you want something from it, don't ask the view, that's just not its job.

You would think that would work. I don't know why it doesn't but I've been here before.

The reason it doesn't work is because the table view only has one cell per column, and moves it around as new data is retrieved from the datasource and displayed. The table VIEW doesn't keep a copy of the data, so you can't ask it for it.


The only information you can ask the table view for is a) which rows are selected and b) what are the names/identifiers of the columns. From that you have what you need to go back to the actual data and do something with it.


--Graham

_______________________________________________

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


  • Follow-Ups:
    • Re: NSTableView
      • From: Graham Cox <email@hidden>
References: 
 >NSTableView (From: Mahaboob <email@hidden>)
 >Re: NSTableView (From: Steven Riggs <email@hidden>)
 >Re: NSTableView (From: Graham Cox <email@hidden>)

  • Prev by Date: Re: NSTableView
  • Next by Date: Re: CALayer contents memory leak
  • Previous by thread: Re: NSTableView
  • Next by thread: Re: NSTableView
  • Index(es):
    • Date
    • Thread