• 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
NSNumber subclassing oddity
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

NSNumber subclassing oddity


  • Subject: NSNumber subclassing oddity
  • From: Jérome Foucher <email@hidden>
  • Date: Mon, 8 Dec 2003 14:48:40 +0100

Hello list !

I've run into an odd problem when trying to subclass NSNumber

My class XRBoolean is defined as below :

@interface XRBoolean : NSNumber
{
}

- (const char *)toto;

@end


@implementation XRBoolean

- (const char *)toto
{
return "c";
}

@end


When I call :
id object = [[XRBoolean alloc] initWithInt:2];

I receive the following error :
*** initialization method -initWithInt: cannot be sent to an abstract
object of class XRBoolean: Create a concrete instance!


I don't really understand. XRBoolean is not an abstract calls (at least
to me)

Am I :
1 : blind
2 : stupid
3 : ignorant
4 : insane
5 : ....

Or is there anything special about NSNumber that I'm not aware of ?

Help me please before I jump out of the window !

Thanks
Jerome
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.

  • Follow-Ups:
    • Re: NSNumber subclassing oddity
      • From: Clark Cox <email@hidden>
  • Prev by Date: Re: .webloc files and Safari (newbie)
  • Next by Date: Using NSWindowDidChangeScreenNotification
  • Previous by thread: Re: .webloc files and Safari (newbie)
  • Next by thread: Re: NSNumber subclassing oddity
  • Index(es):
    • Date
    • Thread