• 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: Unable to programmatically add NSTabViewItem(s) to NSTabView
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Unable to programmatically add NSTabViewItem(s) to NSTabView


  • Subject: Re: Unable to programmatically add NSTabViewItem(s) to NSTabView
  • From: J Tichenor <email@hidden>
  • Date: Wed, 20 Oct 2004 09:14:34 +0100

int const lastReceivedTab = [theMaps count];
int const numberOfTabs = [map_TabView numberOfTabViewItems];
NSNumber *myNum = [[NSNumber alloc] initWithInt:numberOfTabs];


if (lastReceivedTab > numberOfTabs) {
for (k = numberOfTabs; k < lastReceivedTab; k++) {
NSTabViewItem *tabViewItem = [[NSTabViewItem alloc] initWithIdentifier:myNum];
[tabViewItem setView:mapImage1_View];
myNum = [NSNumber numberWithInt:([myNum intValue] + 1)];
[map_TabView addTabViewItem:tabViewItem];
NSLog(@"New Tab count:%i",k);
}
}

Question: Is it possible to programmatically ADD & POPULATE NSTabViewItems or are we stuck with working with pre-defined items via IB?


I don't see where you are pointing to a particular tabViewItem. After you've loaded your new tabViewItems into your tabView, have you tried calling:

<x-tad-bigger> (</x-tad-bigger><x-tad-bigger>NSTabViewItem</x-tad-bigger><x-tad-bigger> *)tabViewItemAtIndex:(int)</x-tad-bigger>index
Returns the tab view item at index in the tab view’s array of items. The index parameter is base 0.

Would assume that would give you a paricular tabView, whether it's old (ie IB built) or new (added at runtime)?

J




Thanks!

Ric.
_______________________________________________
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

_______________________________________________
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: 
 >Unable to programmatically add NSTabViewItem(s) to NSTabView (From: "Frederick C. Lee" <email@hidden>)

  • Prev by Date: [NEWBIE]: Categories, etc vs subclassing
  • Next by Date: Re: [NEWBIE]: Categories, etc vs subclassing
  • Previous by thread: Re: Unable to programmatically add NSTabViewItem(s) to NSTabView
  • Next by thread: NSToolbar and Metal
  • Index(es):
    • Date
    • Thread