In Cocoa do you prefer NSInteger or int, and why?

前端 未结 5 1705
臣服心动
臣服心动 2020-12-02 13:21

NSInteger/NSUInteger are Cocoa-defined replacements for the regular built-in types.

Is there any benefit to using the NS* types over the bu

5条回答
  •  日久生厌
    2020-12-02 13:31

    For importing and exporting data to files or over the net I use UInt32, SInt64 etc...

    These are guaranteed to be of a certain size regardless of the architecture and help in porting code to other platforms and languages which also share those types.

提交回复
热议问题