Re: Question about TableView - how do I know which tableView?
Re: Question about TableView - how do I know which tableView?
- Subject: Re: Question about TableView - how do I know which tableView?
- From: Roarke Lynch <email@hidden>
- Date: Thu, 6 Feb 2003 01:19:20 -0500
One way, which is quick but not quite 100% proper, is :
- (id)tableView:(NSTableView *)aTableView
objectValueForTableColumn:(NSTableColumn *)aTableColumn
row:(int)rowIndex
{
if(aTableView == tableViewOne)
{
//return item for tableViewOne
}
else if(aTableView == tableViewTwo)
{
//return item for tableViewTwo
}
return nil;
}
where tableViewOne and tableViewTwo are connected IBOutlets.
technically you are testing for the equality of addresses, but it works
because your IBOutlet points to the exact object that is making the
call. There might be a more proper way, but this is quick, uncluttered
and fast
On Wednesday, February 5, 2003, at 08:55 PM, Denis Stanton wrote:
>
Hi
>
>
I hope someone can explain something about using tableViews.
>
>
I'm writing a little app that has two table views. I thought I needed
>
two dataSource classes, but as Mike Beam points out in his "Working
>
with tables" column, the methods that are required for tableView each
>
expect to receive an NSTableView parameter "This argument allows for
>
one dataSource object to manage data for multiple table views"
>
>
My question is, how do I test the tableView argument to determine
>
which table view, and therefore which set of data, is being requested?
Roarke Lynch
-------------------------------
email@hidden
_______________________________________________
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.