NSNumber subclassing oddity
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.