• 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
Calling NSNumber class methods on NSDecimalNumber
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Calling NSNumber class methods on NSDecimalNumber


  • Subject: Calling NSNumber class methods on NSDecimalNumber
  • From: Dave Camp <email@hidden>
  • Date: Tue, 22 Apr 2008 08:19:34 -0700

After some testing, it appears that calling NSDecimalNumber with class methods of it's NSNumber parent class return the expected NSDecimalNumber object. For example, [[NSDecimalNumber numberWithDouble:1.1] isKindOfClass:[NSDecimalNumber class]] returns YES (and the resulting object has the correct value)

The problem is that I get the warning "initialization from distinct Objective-C type" when I do this, because the NSNumber class methods return a specific type instead of id.

My question is: is this a bug in the NSNumber headers that I should report, or is this unsafe code and I shouldn't be doing this?

Thanks,
Dave


_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


  • Follow-Ups:
    • Re: Calling NSNumber class methods on NSDecimalNumber
      • From: Jens Alfke <email@hidden>
  • Prev by Date: Re: Font-related crash in drawing method on PowerPC machines
  • Next by Date: Re: [Ann] DMG Canvas
  • Previous by thread: Re: Font-related crash in drawing method on PowerPC machines
  • Next by thread: Re: Calling NSNumber class methods on NSDecimalNumber
  • Index(es):
    • Date
    • Thread