Re: NSTableView app design
Re: NSTableView app design
- Subject: Re: NSTableView app design
- From: Ondra Cada <email@hidden>
- Date: Thu, 27 Apr 2006 19:40:32 +0200
Paul,
On 27.4.2006, at 19:17, Paul Lynch 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.
Correct me please if I am wrong, but I really do not think it does.
Instead, the table view (along with its table columns) uses bindings
to get the data from the controller, named bindings being a
completely and conceptually different mechanism from the elder
NSTableView dataSource.
It is even possible (though generally not desirable for readability
and maintentance purposes) to make one NSArrayController to serve
different tables, some through bindings, others through the data
source protocol. The latter ones can display a completely different
data in such a setup.
---
Ondra Čada
OCSoftware: email@hidden http://www.ocs.cz
private email@hidden http://www.ocs.cz/oc
Attachment:
smime.p7s
Description: S/MIME cryptographic signature
_______________________________________________
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