• 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: indexOfTabViewItemWithIdentifier keeps crashing App
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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

References: 
 >indexOfTabViewItemWithIdentifier keeps crashing App (From: Ole Voß <email@hidden>)

  • Prev by Date: Re: indexOfTabViewItemWithIdentifier keeps crashing App
  • Next by Date: drag and drop workarounds?
  • Previous by thread: Re: indexOfTabViewItemWithIdentifier keeps crashing App
  • Next by thread: drag and drop workarounds?
  • Index(es):
    • Date
    • Thread