|
From: | David Chisnall |
Subject: | Re: NSInteger versus int |
Date: | Thu, 6 Aug 2009 17:55:38 +0100 |
On 6 Aug 2009, at 17:50, Martin Kalbfuß wrote:
When should I use the NS types? I can't see a reason for there exsistens. I'mnot sure if my sdl wrapper should use them.
NSInteger exists to make it easier for C89 code to be 64-bit safe. NSInteger is equivalent to C99's intptr_t; an integer which is guaranteed to be the same width as a pointer. You can safely cast between void* and NSInteger, but you can't (always) safely cast between void* and int.
David
[Prev in Thread] | Current Thread | [Next in Thread] |