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

后端 未结 3 1460
北海茫月
北海茫月 2020-12-29 19:46

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

3条回答
  •  無奈伤痛
    2020-12-29 19:51

    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.

提交回复
热议问题