• 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: NSString to Integer
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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

References: 
 >NSString to Integer (From: Dave DeLong <email@hidden>)
 >Re: NSString to Integer (From: "Sean McBride" <email@hidden>)
 >Re: NSString to Integer (From: Jonathan Hess <email@hidden>)

  • Prev by Date: Re: How to intercept NSToolbar item selection changes
  • Next by Date: MVC, storing VIEW-specific information and core data
  • Previous by thread: Re: NSString to Integer
  • Next by thread: NSTextView won't allow a Return (Enter)
  • Index(es):
    • Date
    • Thread