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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With