Over at In Cocoa do you prefer NSInteger or just regular int, and why?, there was mention of NSDouble
and NSFloat
, but I can\'t see a reference for
It's also about conventions.
A typedef to an int is incompatible to int int itself.
Example: pid_t is of type int, but passing an int would create a warning.
Why? Because you want to be sure that if you cross API boundaries everyone knows what the code expects.
There are float and double types, i.e NSTimeInterval. It's not really about the underlying type, but the convention to adhere to.
If you declare a local int as a loop counter and you do not plan to pass it to a well-defined API, it's fine to call an int an int.