Re: Multiple NSTableView question
Re: Multiple NSTableView question
- Subject: Re: Multiple NSTableView question
- From: Brian Webster <email@hidden>
- Date: Thu, 21 Jun 2001 13:02:21 -0500
On Thursday, June 21, 2001, at 03:50 AM, cocoa-dev-
email@hidden wrote:
I keep reading that by evaluating the theTableView argument used in
- (int)numberOfRowsInTableView:(NSTable *)theTableView
and
- (id)tableView:(NSTableView *)theTableView
objectValueForTableColumn:(NSTableColumn *)theColumn
row:(int)rowIndex
you can distinguish which table view is invoking these methods, when
using more than one table view.
My question is this: Evaluate it against what?
Just compare the pointer values like so:
@interface MyTableDelegate : NSObject
{
IBOutlet NSTableView *table1, *table2;
}
@end
@implementation MyTableDelegate
-(int)numberOfRowsInTableView:(NSTableView*)theTableView
{
if(theTableView == table1)
//return number of rows for table 1
else if(theTableView == table2)
//return number of rows for table 2
}
@end
--
Brian Webster
email@hidden
http://www.owlnet.rice.edu/~bwebster