Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Do NSDouble, NSFloat, or other types than NSInteger exist?

NSInteger exists because the int type varies in size between 32-bit and 64-bit systems. float and double don't vary in size the same way, so there's no need to have wrapper types for them.


There is no NSFloat but I know the Core Graphics API eventually changed from float to CGFloat so that it could use a double on some architectures.

It is best to use the exact types that API headers declare. This makes type changes automatic if you ever recompile your code for a different target.