Re: Multiple TableViews... same Controller?
Re: Multiple TableViews... same Controller?
- Subject: Re: Multiple TableViews... same Controller?
- From: Janakiram Palepu <email@hidden>
- Date: Mon, 6 Nov 2006 14:24:08 +0530
Hi,
Every object passes itself as one of the argument to its delegate
method , so that the delegate( Controller ) will know which object
notifies it.
Example :
- (int)numberOfRowsInTableView:(NSTableView *)aTableView {
if ( aTableView == TableInTab1 ) {
return records1Count;
} else if ( aTableView == TableInTab2 ) {
return records2Count;
}
return 0;
}
There is no need to create a separate controller for each tableview,
its all depends on your application logic.
Let me know if you still have any problem.
Thanks,
JanakiRam.
On 06-Nov-06, at 1:27 PM, Mark Manes wrote:
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?
What if I really do care that the table is exactly the same? I just
want the application to act differently based on what tab the user
is in--so I need to know what tab view I am in -or- I need to know
which table item was selected.
I'd appreciate your wisdom as always..
-mark=
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
40gmail.com
This email sent to email@hidden
_______________________________________________
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