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.
*抱歉,如果之前已经发布过,但我现在一直在寻找 30 分钟,但找不到任何东西*
嗨,我有一个名为 currentcoins 的 NSInteger,我希望硬币的最大值为 999。我已经尝试了所有方法,包括
#undef NSIntegerMax #define NSIntegerMax 999
但 NSInteger 并没有注意到这一点。有没有人有任何解决方案?(我正在为 iOS 做这个)
提前致谢。
您永远不应该重新定义系统定义,例如NSIntegerMax. 这是由您构建应用程序的系统类型(32 位或 64 位)设置的。
NSIntegerMax
只需定义自己的最大值,例如:
#define kMaxCoins 999