NSInteger vs int vs int32_t
NSInteger vs int vs int32_t
- Subject: NSInteger vs int vs int32_t
- From: Andreas Grosam <email@hidden>
- Date: Mon, 02 Jul 2012 13:24:06 +0200
In a public API, I have to specify integer arguments and return values. The API would be for Objective-C on iOS and Mac OS. What is the preferred type to use in several use cases?
For example, one API would need to use an unsigned integer whose values will be quite small, say in a range 0 ... 100, that is an uint16_t would be sufficient. (well, I would choose a uint32_t, here).
Anyway, is it preferable to use always Cocoa macros (NSInteger, NSUInteger, etc.) for an Objective-C API - or may/should I use int, unsigned int, or maybe int32_t, uint32_t, etc. when it seems more appropriate?
_______________________________________________
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