为 iOS 3.1.3 编译,使用 xcode 3.2.3(以及随附的 iOS 4)

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/3099553/
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

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-14 19:28:49  来源:igfitidea点击:

Compiling for iOS 3.1.3, using xcode 3.2.3 (and iOS 4 that came with it)

iphonexcodeios4

提问by Doron

I've downloaded the final version (and never installed any beta versions before) of xcode 3.2.3 with sdk 4, and now I can't seem to find a way to compile my app for a 3.1.3 iOS.

我已经用 sdk 4 下载了 xcode 3.2.3 的最终版本(之前从未安装过任何测试版),现在我似乎找不到为 3.1.3 iOS 编译我的应用程序的方法。

Does anybody know how can I do that ?

有谁知道我该怎么做?

回答by Jason Coco

As it is, you can't. They probably did this on purpose to discourage new apps compiled for 3.1.3 which foils multitasking.

事实上,你不能。他们可能是故意这样做的,以阻止为 3.1.3 编译的新应用程序,这会阻碍多任务处理。

Instead you can compile for iOS 4 but make your deployment target 3.1.3. This doesn't really require any more real work, as long as you don't use any non-3.1.3 methods/classes etc. and the application can install and run on a 3.1.3 device. You can also then make your application multitasking aware so that it works nicely on a device that does run iOS 4 and is capable of multitasking.

相反,您可以针对 iOS 4 进行编译,但将部署目标设为 3.1.3。只要您不使用任何非 3.1.3 方法/类等,并且该应用程序可以在 3.1.3 设备上安装和运行,这实际上并不需要更多实际工作。然后,您还可以让您的应用程序具有多任务处理能力,以便它在运行 iOS 4 且能够进行多任务处理的设备上正常运行。

Just a note: the Base SDK may be set at the project level, but you will need to go to the build settings for the target itself to set the deployment target (that setting is not available at the project level).

请注意:Base SDK 可能在项目级别设置,但您需要转到目标本身的构建设置来设置部署目标(该设置在项目级别不可用)。

回答by AndyD273

To expand on Jason Coco's answer: If you go to the Project Info screen and click Build, you can choose what Base SDK to use (4.0) and then scroll down to iPhone OS Deployment Target version and set it to 3.1.3 or whatever. However, you also have to go to the Targets section under Groups & Files (red bullseye) select your target and get the Info build page, and set your iPhone OS Deployment Target there too.

要扩展 Jason Coco 的答案:如果您转到“项目信息”屏幕并单击“构建”,您可以选择要使用的基础 SDK (4.0),然后向下滚动到 iPhone OS 部署目标版本并将其设置为 3.1.3 或其他版本。但是,您还必须转到 Groups & Files(红色靶心)下的 Targets 部分,选择您的目标并获取 Info build 页面,并在那里设置您的 iPhone OS 部署目标。

Once that's done, you should be able to test it with a device that's still running 3.0 or whatever you selected.

完成后,您应该能够使用仍在运行 3.0 或您选择的任何设备的设备对其进行测试。

回答by Alexander Voloshyn

if you want to be compatible with iPhone OS 3.x you still compile for SDK 4.0, but open target settings and choose that application can run on 3.x (iPhone OS Deployment Target). If you did not use any iOS 4.0 specific APIs then your app will run smoothly on 3.x and 4.x, here is a screenshot of setting to change:
Screenshot

如果您想与 iPhone OS 3.x 兼容,您仍然为 SDK 4.0 进行编译,但打开目标设置并选择该应用程序可以在 3.x(iPhone OS 部署目标)上运行。如果您没有使用任何 iOS 4.0 特定的 API,那么您的应用程序将在 3.x 和 4.x 上流畅运行,这里是更改设置的屏幕截图:
屏幕截图