Re: NSString to Integer
Re: NSString to Integer
- Subject: Re: NSString to Integer
- From: Shawn Erickson <email@hidden>
- Date: Mon, 9 Mar 2009 10:14:46 -0700
On Sat, Mar 7, 2009 at 9:37 PM, Jonathan Hess <email@hidden> wrote:
> When using a 64-bit architecture, Mac OS X uses 32 bit integers, but 64 bit
> longs. NSInteger is defined as a long for 64, not an integer.
>
> When running 64-bit, you need to use %ld as the format option.
( bit width with 32b arch / bit width with 64b arch )
%lld <==> long long <==> 64b / 64b
%ld <==> long <==> 32b / 64b (aligns with how NSInteger changes size)
%d <==> int <==> 32b / 32b
%p <==> void* <==> 32b / 64b
etc.
_______________________________________________
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