如何知道是否iOS应用构建为64位。iOS

2023-09-08 00:04:57 作者:此心已废

我想建立一个iPhone应用程序为64位。我怎么知道天气是构建32位还是64位?

I am trying to build an iOS Application for 64 bit. How do I know weather it is build for 32 bit or 64 bit ?

请问的Mach-O-视图可以帮助?如果是,去哪里找呢? 也有它的任何命令行。 ?

Does Mach-O-View can help ? if Yes, where to look for it ? Also is there any command line for it. ?

我下文称这个,但它并不能帮助我知道天气这一点,是建还是不为64位。 https://developer.apple.com/library/ios/documentation/General/Conceptual/CocoaTouch64BitGuide/ConvertingYourAppto64-Bit/ConvertingYourAppto64-Bit.html#//apple_ref/doc/uid/TP40013501-CH3-SW1

I reffered this but it does not help me to know weather this it is built or not for 64 bit. https://developer.apple.com/library/ios/documentation/General/Conceptual/CocoaTouch64BitGuide/ConvertingYourAppto64-Bit/ConvertingYourAppto64-Bit.html#//apple_ref/doc/uid/TP40013501-CH3-SW1

推荐答案

试试这个:

#ifdef __LP64__
// NSLog(@"64");
#else
// NSLog(@"32");
#endif

它适用于OS X,但我没有测试它的iOS(我没有一个iPhone5S :()。

It works for OS X, but I didn't test it for iOS (I don't have an iPhone5S :( ).

编辑:

顺便说一句,它工作正常在iPhone模拟器。

By the way, it works fine on iPhone Simulator.