Re: folder content as model for NSTableView
Re: folder content as model for NSTableView
- Subject: Re: folder content as model for NSTableView
- From: Torsten Curdt <email@hidden>
- Date: Tue, 19 Feb 2008 00:14:20 +0100
On 16.02.2008, at 03:10, Kyle Sluder wrote:
On Feb 15, 2008 5:50 PM, Torsten Curdt <email@hidden> wrote:
Ehm ...I am still a newbie that basically started my first real Cocoa
project about 1,5 weeks ago. So old-school "data source" does not
tell me that much yet :) Care to elaborate?
Table views have to ways of getting their data. One is through
binding, which is typically done to an NSArrayController; this is the
newer technology. Prior to the introduction of Cocoa Bindings, you
would use what's called a "data source", the full guide to which can
be found here: http://developer.apple.com/documentation/Cocoa/
Conceptual/TableView/Tasks/UsingTableDataSource.html
The gist of it is that you wire up an object that implements the
NSTableDataSource informal protocol (read the Cocoa introductory docs
if you don't understand what an informal protocol is) to the table
view's dataSource outlet. When the table needs to display a row, it
sends a message to your data source object asking it how many rows are
in the table, and for the data in each column. Your data source
replies with this information, which the table view uses to draw the
cells and then discards. When the underlying data set changes, some
object (could be your data source, could be another object) sends a
message to the table view telling it to refresh itself for a specific
range of rows, or for the entire dataset, at which point it queries
your data source object again.
Ah, I remember I have played with that before. Thanks Kyle!
_______________________________________________
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