Re: NSTableView
Re: NSTableView
- Subject: Re: NSTableView
- From: Graham Cox <email@hidden>
- Date: Wed, 5 Nov 2008 15:57:18 +1100
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