• 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: Cast NSNumber to int
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Cast NSNumber to int


  • Subject: Re: Cast NSNumber to int
  • From: Philip Vallone <email@hidden>
  • Date: Sat, 28 Nov 2009 06:36:09 -0500

Thanks for the quick response. Works like a charm!



On Nov 28, 2009, at 6:26 AM, Andrew Farmer wrote:

> On 28 Nov 2009, at 03:20, Philip Vallone wrote:
>> I want to cast a NSNumber to int. When I execute the below code, my result should be 1, not 68213232. What am I doing wrong?
>
> You are trying to cast a pointer to an integer and expecting meaningful results. Don't.
>
> If you want to get the numeric value of a NSNumber object, use its intValue (or floatValue, longValue, etc.) method.

_______________________________________________

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

References: 
 >Cast NSNumber to int (From: Philip Vallone <email@hidden>)
 >Re: Cast NSNumber to int (From: Andrew Farmer <email@hidden>)

  • Prev by Date: Re: Cast NSNumber to int
  • Next by Date: Re: Apache Module
  • Previous by thread: Re: Cast NSNumber to int
  • Next by thread: Confused about Memory Management with Collections
  • Index(es):
    • Date
    • Thread