Re: Newbie: two tables on one window, how to talk to them?
Re: Newbie: two tables on one window, how to talk to them?
- Subject: Re: Newbie: two tables on one window, how to talk to them?
- From: Ondra Cada <email@hidden>
- Date: Mon, 2 Sep 2002 19:09:08 +0200
On Monday, September 2, 2002, at 06:24 , Keith Pritchard wrote:
On Monday, September 2, 2002, at 04:59 PM, Tony S. Wu wrote:
- (int) numberOfRowsInTableView:(NSTableView *)aTableView
{
if (aTableView == myTableViewOutlet)
// do something
else if (aTableView == mySecondTableViewOutlet)
// do something else
}
Thanks! confirms what I was doing (except for the = rather than ==
typo... too much basic/delphi recently, not enough C.
There's another possible solution of course: you might make another data
source/controller for the other table. Which one of the possible solution
is better depends on the code: the simpler each controller and the more
intimately they co-operate, the better the quoted solution. OTOH, the more
complicated controller code and the more both tables are independent, the
better is usage of different instances.
How does it work for notifications though?
I have
- (void)tableViewSelectionDidChange:(NSNotification *)aNotification
{
NSTableView *tv=[aNotification object];
if (tv==myTableViewOutlet) ...
NSLog(@"Selected row %i, Group %@",[tableview1 selectedRow],[myArray
objectAtIndex:[tableview1 selectedRow]] );
}
---
Ondra Cada
OCSoftware: email@hidden
http://www.ocs.cz
private email@hidden
http://www.ocs.cz/oc
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.