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

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.

  • Follow-Ups:
    • Re: NSNumber subclassing oddity
      • From: Jérome Foucher <email@hidden>
References: 
 >NSNumber subclassing oddity (From: Jérome Foucher <email@hidden>)

  • Prev by Date: Re: .webloc files and Safari (newbie)
  • Next by Date: Re: NSNumber subclassing oddity
  • Previous by thread: NSNumber subclassing oddity
  • Next by thread: Re: NSNumber subclassing oddity
  • Index(es):
    • Date
    • Thread