Re: NSNumber subclassing oddity
Re: NSNumber subclassing oddity
- Subject: Re: NSNumber subclassing oddity
- From: Clark Cox <email@hidden>
- Date: Mon, 8 Dec 2003 09:13:35 -0500
On Dec 08, 2003, at 08:48, Jirome Foucher wrote:
>
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)
No, but NSNumber is. NSNumber is a class-cluster. Check out:
http://developer.apple.com/documentation/Cocoa/Conceptual/Foundation/
Concepts/ClassClusters.html
--
Clark S. Cox III
email@hidden
http://homepage.mac.com/clarkcox3/blog/B1196589870/index.html
[demime 0.98b removed an attachment of type application/pkcs7-signature which had a name of smime.p7s]
_______________________________________________
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.