Re: How to Distinguish Between Two TableViews
Re: How to Distinguish Between Two TableViews
- Subject: Re: How to Distinguish Between Two TableViews
- From: Uli Kusterer <email@hidden>
- Date: Mon, 18 Oct 2010 22:31:16 +0200
On 18.10.2010, at 01:29, Chris Share wrote:
> I'm new to Cocoa. I'm developing a simple application that contains two
> TableViews. What I can't figure out is how to distinguish between the two
> TableView pointers that are passed in to:
>
> - (int)numberOfRowsInTableView:(NSTableView *) tableView
> - (id)tableView:(NSTableView *)tableView
> objectValueForTableColumn:(NSTableColumn *)tableColumn row:(int)row
>
> How do I do this?
This is a code smell, i.e. a sign that you're likely doing something in a way that it wasn't intended to be done.
Don't try to distinguish between them, give them each a separate data source/delegate object. That way, you get only one table's messages, and it's obvious which one it came from.
-- Uli Kusterer
"The Witnesses of TeachText are everywhere..."
http://www.masters-of-the-void.com
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden