• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: How to Distinguish Between Two TableViews
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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

  • Follow-Ups:
    • Re: How to Distinguish Between Two TableViews
      • From: Graham Cox <email@hidden>
References: 
 >How to Distinguish Between Two TableViews (From: Chris Share <email@hidden>)

  • Prev by Date: Re: AM/PM letter UNICODE issues
  • Next by Date: Re: NSDictionary allValues not mutable
  • Previous by thread: Re: How to Distinguish Between Two TableViews
  • Next by thread: Re: How to Distinguish Between Two TableViews
  • Index(es):
    • Date
    • Thread