Re: NSTableView app design
Re: NSTableView app design
- Subject: Re: NSTableView app design
- From: Scott Frankel <email@hidden>
- Date: Thu, 27 Apr 2006 11:12:22 -0700
Thanks for the responses. They definitely help clarify.
Your comment below about different tables brings up another
question. The app I'm planning has more than one tableView. I
assume that by creating an NSArrayController object in IB for each
tableView -- and setting its Object Class Name to correspond with the
correct implementation file -- then all tableViews can co-exist in
the same app. Yes?
Thanks again!
Scott
On Apr 27, 2006, at 10:40 AM, Ondra Cada wrote:
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
_______________________________________________
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