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.
由于我们已经开始使用 iOS7 - 并且在编码过程中遇到了一些问题 - 即我们如何比较 iPhone5 和 iPhone 5S - 这样我们就可以检查系统是 32 位还是 64 位,并可以相应地使用变量。
如果您想通过编译时条件执行此操作,则定义了一个新的“ __arm64__”条件,现在可用于 64 位编译代码。
__arm64__
大概“ __arm__”是为 32 位设备代码定义的。
__arm__
您可能还会注意到 Xcode 中除了“armv6、armv7 和 armv7s”还有一个新的可用架构,即“arm64”。
所以你可以做这样的事情:
#ifdef __arm64__ NSLog( @"we're running 64-bit"); else NSLog( @"32-bit iphone code"); #endif