Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: How do you create a NSTabViewItem containing NSImageView programmatically? I almost got it...



You are CORRECT!
I've changed the NSNumber to NSString, using an arbitrary @"foo" and test it for one new TAB. The 'selector not recognized' error went away!

Original:
NSNumber *myNum = [[NSNumber alloc] initWithInt:numberOfTabs];
NSTabViewItem *tabViewItem = [[NSTabViewItem alloc] initWithIdentifier:MyNum];

Modified:
NSTabViewItem *tabViewItem = [[NSTabViewItem alloc] initWithIdentifier:@"foo"];

So apparently this must be a bug!

I'll file a bug report when I find the URL for it.

Thanks for the insight!

Regards,

Ric.

On Oct 21, 2004, at 3:57 PM, Scott Stevenson wrote:

On Oct 21, 2004, at 3:41 PM, Frederick C. Lee wrote:

2004-10-21 12:22:28.786 ricCountries[961] *** -[NSCFNumber length]: selector not recognized
2004-10-21 12:22:28.787 ricCountries[961] *** -[NSCFNumber length]: selector not recognized

This looks like something is expecting an NSString but getting an NSNumber. Try using an string for the tab identifier instead of a number.

[NSString stringWithFormat:@"%i", someInt];

The API indicates "id" as the identifier type so NSNumber should be okay, but it could be a bug. Not sure if this will work but worth a try.

- Scott



_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/email@hidden

This email sent to email@hidden


Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.