Re: NSTableView app design
Re: NSTableView app design
- Subject: Re: NSTableView app design
- From: Paul Lynch <email@hidden>
- Date: Thu, 27 Apr 2006 18:17:03 +0100
On 27 Apr 2006, at 18:02, Scott Frankel wrote:
In both Hillegas' chapter on Helper Objects and Apple's online docs
on using NSTableViews, methods are used to explicitly return the
number of rows in a table and the value of an object in a specific
column (as well as setting the value). In the following chapter on
Bindings, none of these methods is called. An NSArrayController
appears to handle those tasks. Do I have this correct? Does using
the view's bindings obviate the need to call
numberOfRowsInTableView:, &c.?
Yes. An NSArrayController acts as an NSTableView dataSource for it's
array.
Also, if I understand correctly, a tableView object's data source
is considered part of the app's controller, in M-V-C terms.
Yes - or, more accurately, part of the controller layer.
Using bindings and key-value coding style accessors, the
functionality that would've been handled by the controller is now
accessed directly in/from the model. Is this correct?
No. The NSArrayController is part of the controller layer. The key
point is that the controller can consist of multiple layers, and can
reference the model objects at any point.
Paul
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden