iOS 64位模拟器真的是64位吗?

Hot*_*ard 3 objective-c ios

根据主要的64位更改 int和长大小是4和8字节.但是当我使用以下代码在iOS 64位模拟器上运行时:

NSLog(@"NSInteger size: %i", sizeof(NSInteger));
NSLog(@"int       size: %i", sizeof(int));
NSLog(@"long      size: %i", sizeof(long));
Run Code Online (Sandbox Code Playgroud)

输出是

 NSInteger size: 4
 int       size: 4
 long      size: 4
Run Code Online (Sandbox Code Playgroud)

所以,尺寸告诉我们另一个.真实设备上的输出是什么?

Nik*_* M. 9

是的,模拟器是64位的.你得到这个输出,因为你的应用程序可能不是为64位编译的.在项目设置中选择以下内容(包括64位)

在此输入图像描述