• 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: Michael Dautermann <email@hidden>
  • Date: Mon, 18 Oct 2010 13:27:17 -0700

On Oct 17, 2010, at 4:29 PM, 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?
>
> In IB the Names and IDs of the two table views are different - do I somehow need
> to use these? If so, how?

There's a number of ways to do this....

Easiest is to match the incoming tableView to the IBOutlet from your XIB/NIB, e.g.:

- (int)numberOfRowsInTableView:(NSTableView *) tableView
{
	if( tableView == myFirstTable )
	{

	}
	if( tableView == mySecondTable )
	{

	}
}

Tables don't have "names" per se.

Hope this helps,



Attachment: smime.p7s
Description: S/MIME cryptographic signature

_______________________________________________

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: Conrad Shultz <email@hidden>
References: 
 >How to Distinguish Between Two TableViews (From: Chris Share <email@hidden>)

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