• 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 find the name of the tab view item if you have one of its sub-views(sub-sub-views)?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: How to find the name of the tab view item if you have one of its sub-views(sub-sub-views)?


  • Subject: Re: How to find the name of the tab view item if you have one of its sub-views(sub-sub-views)?
  • From: Keith Wilson <email@hidden>
  • Date: Tue, 14 Mar 2006 10:23:23 +1100

On 13 Mar 2006, at 22:46, Andrei Tchijov wrote:

Yes. Typically I am getting reference to "particular view" as a sender parameter to an action. What exactly action will do, depends on on which "tab" this sender located.


Hi Andrei,

The Tabview identifier can be set in IB as a string but can later be reassigned to any Object.

Let's assume that each tab contains an NSTableView called pTable1, pTable2, pTable2 and these have IBOutlets in the controller for your tabview.

In Interface Builder give each tab in the tabview an Identifier - a NSString - that is called table1, table2, table3, etc

In awakeFromNib change each tab identifier to be the NSTableView object table1, table2, table3, etc using

	if(tvi identifier] isEqualToString:@"table1"]
		[tvi setIdentifier:pTable1];
	if(tvi identifier] isEqualToString:@"table2"]
		[tvi setIdentifier:pTable2];
	etc ....

Now each tab knows the object that it is associated with without worrying about traversing the view hierarchy and you can do things like

	NSTabViewItem *tvi = [pTabView selectedTabViewItem];
	if([[tvi identifier] respondsToSelector:@selector(doSomething:)])
		[[tvi identifier] doSomething:xxxxt];

Keith from DownUnder


_______________________________________________ Do not post admin requests to the list. They will be ignored. Cocoa-dev mailing list (email@hidden) Help/Unsubscribe/Update your Subscription: This email sent to email@hidden
References: 
 >How to find the name of the tab view item if you have one of its sub-views(sub-sub-views)? (From: Andrei Tchijov <email@hidden>)
 >Re: How to find the name of the tab view item if you have one of its sub-views(sub-sub-views)? (From: Mike Abdullah <email@hidden>)
 >Re: How to find the name of the tab view item if you have one of its sub-views(sub-sub-views)? (From: Andrei Tchijov <email@hidden>)
 >Re: How to find the name of the tab view item if you have one of its sub-views(sub-sub-views)? (From: Mike Abdullah <email@hidden>)

  • Prev by Date: Re: Registering software
  • Next by Date: Re: Getting local timezone as integer
  • Previous by thread: Re: How to find the name of the tab view item if you have one of its sub-views(sub-sub-views)?
  • Next by thread: Re: How to find the name of the tab view item if you have one of its sub-views(sub-sub-views)?
  • Index(es):
    • Date
    • Thread