Xcode 4 中“我的 Mac 32 位”和“我的 Mac 64 位”之间的区别?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/6453687/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Difference between "My Mac 32-bit" and "My Mac 64-bit" in Xcode 4?
提问by Craig Otis
I have a Cocoa project that I recently imported into Xcode 4. I notice two Schemes for each of my specific build targets, one for 32-bit, and one for 64-bit. My Project settings are set to "Standard (32/64-bit Intel)".
我最近将一个 Cocoa 项目导入到 Xcode 4。我注意到每个特定构建目标都有两个 Schemes,一个用于 32 位,一个用于 64 位。我的项目设置设置为“标准(32/64 位英特尔)”。
When I select the "My Mac 32-bit" Scheme, does this compile it for 32-bit machines, and selecting "My Mac 64-bit", then compiles it for 64-bit machines? If I select the "My Mac 64-bit" Scheme, will it no longer run on 32-bit machines at all?
当我选择“My Mac 32-bit”Scheme 时,是否为 32 位机器编译它,然后选择“My Mac 64-bit”,然后为 64 位机器编译它?如果我选择“我的 Mac 64 位”方案,它会不会再在 32 位机器上运行?
采纳答案by Jared Updike
The Scheme setting changes what happens in Xcode when you click Run, Build, etc. The architecture settings are changed inside the project settings, visible in your screen shot. Only there would you be able to chose "32-bit only" or "64-bit only". And it is likely that if you publish a binary with 64-bit only it wouldn't run on 32-bit machines. You would have to build for both platforms and include both binaries in a single Universal binary to get backwards compatibility with 32-bit-only Macs.
当您单击“运行”、“构建”等时,Scheme 设置会更改 Xcode 中发生的情况。架构设置会在项目设置内更改,在您的屏幕截图中可见。只有在那里您才能选择“仅 32 位”或“仅 64 位”。并且很可能如果您仅发布 64 位二进制文件,它可能无法在 32 位计算机上运行。您必须针对两个平台进行构建,并将两个二进制文件包含在一个通用二进制文件中,以获得与 32 位 Mac 的向后兼容性。
回答by Laurent Bourgault-Roy
Mac OS X allow you to run 64 bits software on 32 bits Mac OS X and the reverse, 32 bits software on 64 bits Mac OS X. If your software use a lot of memory, don't hesitate to choose the 64 bits option. Else, you should benchmark to see what is better, as 64 bits software on a 32 bits kernel tend to have a bit of a performance hit.
Mac OS X 允许您在 32 位 Mac OS X 上运行 64 位软件,反之,在 64 位 Mac OS X 上运行 32 位软件。如果您的软件使用大量内存,请不要犹豫选择 64 位选项。否则,您应该进行基准测试以查看哪个更好,因为 32 位内核上的 64 位软件往往会对性能造成一些影响。
some more info about it : http://macperformanceguide.com/SnowLeopard-64bit.html
关于它的更多信息:http: //macperformanceguide.com/SnowLeopard-64bit.html
回答by Conor
Changing the scheme setting from "My Mac 32-bit" to "My Mac 64-bit" does not change how the app is compiled. It only changes what binary version is launched immediately on your machine for testing or profiling. The app continues to have both binaries for 32 and 64 bit compiled and included in the final product for shipping as a universal application.
将方案设置从“我的 Mac 32 位”更改为“我的 Mac 64 位”不会改变应用程序的编译方式。它只会更改在您的机器上立即启动以进行测试或分析的二进制版本。该应用程序继续编译 32 位和 64 位二进制文件,并将其包含在最终产品中,以作为通用应用程序交付。