indexOfTabViewItemWithIdentifier keeps crashing App
indexOfTabViewItemWithIdentifier keeps crashing App
- Subject: indexOfTabViewItemWithIdentifier keeps crashing App
- From: Ole Voß <email@hidden>
- Date: Fri, 10 Dec 2004 09:33:55 +0100
I've got a simple TabView with three tabs.
When my delegate gets sent the message 'willSelectTabViewItem' I want to
retrieve the index of the previous tab.
This is purely for educational purposes.
- (void)tabView:(NSTabView *)tabView
willSelectTabViewItem:(NSTabViewItem *)tabViewItem
{
NSLog(@"current tab %@",[[tabView selectedTabViewItem] label]);
NSLog(@"current idx %@",[tabView indexOfTabViewItem:[tabView
selectedTabViewItem]]);
NSLog(@"willSelectTabViewItem %@",[tabViewItem label]);
}
When I run the App, it will return (null) as the index for the first tab
I click. The next tab I select will make the App crash.
When simply asking for the label as in the first line, it works fine -
so obviously I'm getting the TabViewItem object.
What am I doing wrong? Google does offer much information on the topic.
Regards,
Ole.
_______________________________________________
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