On Jul 2, 2012, at 1:10 PM, Jens Alfke <j...@mooseyard.com> wrote:
> I really don't understand the thought behind creating NSInteger. It seems 
> dangerous to have a 'standard' type whose size isn't fixed. It leads to 
> mistakes like storing a file size in an NSUInteger — that's fine in 64-bit, 
> but in a 32-bit app it blows up on large files. I thought we'd already 
> learned this lesson with the old C 'int' type, which has been giving people 
> cross-platform problems since the 1970s.

NSInteger exists to allow APIs to use 64-bit integers in 64-bit mode while 
preserving source- and binary-compatibility in 32-bit mode. If you start with a 
pile of 32-bit code that uses `int` and `@encode(int)`, then NSInteger is the 
correct way to move forward to 64-bit.


-- 
Greg Parker     gpar...@apple.com     Runtime Wrangler



_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to