• 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
MultipleNibTabView example SOLVED
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

MultipleNibTabView example SOLVED


  • Subject: MultipleNibTabView example SOLVED
  • From: Boyd Collier <email@hidden>
  • Date: Mon, 6 Mar 2006 22:00:25 -0800

Yesterday I posted the following message:

In the sample project MultipleNibTabView when the tab view first appears, the view from EnterTex.nib is not displayed. The user must first select the Select Colors tab and then the Enter Text tab to get "Type here and press return" displayed, which doesn't seem like it's the way things should work from a user's perspective. I've tried to change the sample code so that the contents of EnterTex.nib are displayed upon launch but haven't succeeded in finding the right way to do this. If anyone can provide what seems to be the missing code, I'd be very appreciative.

Greg Herlihy suggested that one of my files was corrupted, and he was right. However, there's more to the story, and perhaps this note will save another newcomer to cocoa (a class to which I belong) a lot of time learning what I just learned. Or perhaps someone can point to documentation that I overlooked (and which should be pointed out in the readme file accompanying the MultipleNibTabView example).


In the nib MainMenu.nib of Apple's example, there is a tab view with 2 tabs, and the second of these, "Set Colors", is selected. I inadvertently changed this to the first tab being selected in the nib. The class WindowController has a method awakeFromNib that contains [multipleNibTabView selectTabViewItemWithIdentifier:@"1"];
When this line of code is executed, the following gets executed if and only if the first tab is not already set:


- (void)tabView:(NSTabView*)tabView didSelectTabViewItem: (NSTabViewItem*)tabViewItem;

But if the above line isn't called when the tab view is loaded (and it won't be if the first tab is selected in the nib), then the nib EnterText doesn't get loaded. Only after the user selects the second tab and then selects the first tab does the desired view get loaded. Okay -- did I overlook something that I should have been aware of?

Boyd
_______________________________________________
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: 
 >MultipleNibTabView example from Apple (From: Boyd Collier <email@hidden>)

  • Prev by Date: drag & drop and the "+" sign
  • Next by Date: Re: drag & drop and the "+" sign
  • Previous by thread: Re: MultipleNibTabView example from Apple
  • Next by thread: Listing all selectors for an object
  • Index(es):
    • Date
    • Thread