Re: Multiple TableViews... same Controller?
Re: Multiple TableViews... same Controller?
- Subject: Re: Multiple TableViews... same Controller?
- From: Matt Neuburg <email@hidden>
- Date: Mon, 06 Nov 2006 12:20:35 -0800
- Thread-topic: Multiple TableViews... same Controller?
On Sun, 5 Nov 2006 23:57:59 -0800, Mark Manes <email@hidden> said:
>I have an application where I have two tables. One is in one tab and
>the other table is in another tab. They actually will show the same
>data (but that is not really all that important).
>
>I would like to know if I can tell when I get the following methods--
>how do I tell what table it is?
>
>- numberOfRowsInTableView
>- objectValueForTableColumn
>- tableViewSelectionDidChange
>
>Do I really need to create a controller class for every table I create?
A table doesn't involve a "controller class". numberOfRowsInTableView and
tableView:objectValueForTableColumn are sent to the table's data source;
tableViewSelectionDidChange is sent to the table's delegate. These can be
the same object or different objects (or a combination thereof; I often use
message forwarding so that the delegate acts as the datasource for some
calls but not others).
As others have told you, all three have an NSTableView parameter (actually
what the third has is an NSTableView notification object). So your code
always knows what table view is speaking. m.
--
matt neuburg, phd = email@hidden, <http://www.tidbits.com/matt/>
A fool + a tool + an autorelease pool = cool!
AppleScript: the Definitive Guide - Second Edition!
<http://www.amazon.com/gp/product/0596102119>
_______________________________________________
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