• 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: Retrive NSTabViewItem from its outlet
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Retrive NSTabViewItem from its outlet


  • Subject: Re: Retrive NSTabViewItem from its outlet
  • From: Lorenzo <email@hidden>
  • Date: Thu, 26 Jan 2006 11:18:53 +0100

I realized this:
the awakeFromNib of the slider comes BEFORE the awakeFromNib of the tabView.
That's why I cannot retrive the tabView from the slider in the slider's
awakeFromNib method. So now I am stuck. What can I do?

I am doing all of that because I have a panel (an Inspector) FULL of hundred
of outlets grouped in several NSTabViewItem within a NSTabView.
So in IB I would like to just set a tag to each outlet (any outlet is my
custom class), and in the awakeFromNib method I assign easily setTarget and
setAction depending on which NSTabViewItem they belong to, and their tag.
This way I don't have to create hundreds IBOutlet id in my header file, I
don't have to connect the outlet to the main class, I don't have to assign
an action nor a target to the outlets in IB. Cool, no?


Best Regards
--
Lorenzo
email: email@hidden

> From: Ricky Sharp <email@hidden>
> Date: Wed, 25 Jan 2006 20:00:01 -0600
> To: Lorenzo <email@hidden>
> Cc: email@hidden
> Subject: Re: Retrive NSTabViewItem from its outlet
>
>
> On Jan 25, 2006, at 4:10 PM, Lorenzo wrote:
>
>> I have a slider in a NSTabViewItem
>> In the slider awakeFromNib method I would like to retrive its
>> NSTabViewItem.
>> I tried this unsuccessfully.
>>
>>     id    tabItem = [self superview];
>>     NSLog(@"slider tag %d tabIdentif %@", [self tag], [tabItem
>> identifier]);
>>
>> and
>>
>>     id    tabItem = [[self superview] superview];
>>     NSLog(@"slider tag %d tabIdentif %@", [self tag], [tabItem
>> identifier]);
>>
>> I think that I need something else than the second superview in the
>> second
>> piece of code. Any idea?
>
> NSTabViewItem isn't an NSView.  So, the superview of the slider will
> be the NSTabView.  From there, you can get a hold of the current
> tabViewItem that is being displayed.
>
> ___________________________________________________________
> Ricky A. Sharp         mailto:email@hidden
> Instant Interactive(tm)   http://www.instantinteractive.com
>

 _______________________________________________
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: 
 >Re: Retrive NSTabViewItem from its outlet (From: Ricky Sharp <email@hidden>)

  • Prev by Date: Re: Retrive NSTabViewItem from its outlet
  • Next by Date: multiple iSight stream same time?
  • Previous by thread: Re: Retrive NSTabViewItem from its outlet
  • Next by thread: NSBitmapImageRep representationUsingType crashes.....
  • Index(es):
    • Date
    • Thread