Re: indexOfTabViewItemWithIdentifier keeps crashing App
Re: indexOfTabViewItemWithIdentifier keeps crashing App
- Subject: Re: indexOfTabViewItemWithIdentifier keeps crashing App
- From: Andrew Farmer <email@hidden>
- Date: Fri, 10 Dec 2004 01:16:44 -0800
On 10 Dec 2004, at 00:33, Ole Voß wrote:
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.
That would probably be because indexOfTabViewItem returns an integer,
not an id. Try formatting it as "%d", not "%@".Attachment:
PGP.sig
Description: This is a digitally signed message part
_______________________________________________
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