Re: Unable to programmatically add NSTabViewItem(s) to NSTabView
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