Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
在 iPhone 编程中使用 NSInteger 和 int 的原因是什么?谢谢。
AnNSInteger只是具有以下定义的 typedef:
NSInteger
#if __LP64__ || NS_BUILD_32_LIKE_64 typedef long NSInteger; typedef unsigned long NSUInteger; #else typedef int NSInteger; typedef unsigned int NSUInteger; #endif
由于 typedef 根据平台定义不同,您可以继续NSInteger独立于平台使用。