简体   繁体   English

我可以使用Xcode 3.1为iOS版本4.0、4.3和5开发应用程序吗

[英]Can I use Xcode 3.1 to develop app for iOS version 4.0, 4.3 and 5

I want to develop an iphone app, I only have OSX 10.5 so I can only install xcode 3.1, can I developer App for iOS version 4.0, 4.3, and 5 respectively? 我想开发一个iPhone应用程序,我只有OSX 10.5,所以只能安装xcode 3.1,我可以分别为iOS版本4.0、4.3和5开发应用程序吗? Or I must upgrade to OSX 10.7 Lion and install xcode 4.2? 还是我必须升级到OSX 10.7 Lion并安装xcode 4.2?

More specifically, if I use xcode 3.1 and develop an app, will it runs on iphone 4 and 4S? 更具体地说,如果我使用xcode 3.1并开发一个应用程序,它将在iPhone 4和4S上运行吗?

据我所知,您将无法使用XCode 3.1开发那些iOS版本,很不幸,您将需要升级。

You'll need to upgrade, at least to Snow Leopard (10.6) to be able to develop for iOS 5, as 10.5 is not longer supported 您需要至少升级到Snow Leopard(10.6)才能针对iOS 5开发,因为不再支持10.5

edit: short answer yes, it will most likely be able to run, but you missed out on so many features added in iOS 4++, also, it's likely you won't be able to test your app on iPhone 4/4S, not sure about iPhone 4, but 4S surely won't get recognized by your XCode 编辑:简短回答是的,它很可能可以运行,但是您错过了iOS 4 ++中添加的许多功能,而且,您很可能无法在iPhone 4 / 4S上测试您的应用,不确定iPhone 4,但您的XCode肯定不会识别4S

You can develop for newer ios on older XCodes. 您可以在较旧的XCodes上针对较新的ios开发。 And, its a matter of managing PATHS nd VERSIONS 而且,这是管理路径和版本的问题

STEP 1. What is known as XCode is more accurately a bundle of a IDE with a SDK. 步骤1.更准确地说,所谓的XCode是将IDE与SDK捆绑在一起。 Nevertheless, the two are separate. 尽管如此,两者是分开的。 I have 3.2 and 4.0 xcodes on the same machine. 我在同一台计算机上有3.2和4.0 xcode。 no hitch at all. 完全没有障碍。 I used the older 3.2 IDE until the 4.0 IDE became a bit more familiar. 我使用了较旧的3.2 IDE,直到4.0 IDE变得更加熟悉为止。

One way is to organize your directory structure around the following schema. 一种方法是围绕以下架构组织目录结构。

 /Developer_3.x.x
 /Developer_4.x.x

Another method is to use only one /Developer and copy the SDK and platforms from one into another. 另一种方法是仅使用一个/ Developer并将SDK和平台从一个复制到另一个。

/Developer/SDKs
/Developer/Platforms

*The reason that is easy: those are the expected search PATHS *简单的原因:这些是预期的搜索路径

The cleaner and slightly more difficult route is setting the Project build settings under Project | 更干净,更困难的路线是在“项目” |“项目”下设置“项目构建”设置。 Build | 建立 Architecture 建筑

The two settings are the two top-most ones. 这两个设置是最上面的两个。 "Additional SDKs" sets the ADDITIONAL_SDK variable. “其他SDK”设置ADDITIONAL_SDK变量。 "Base SDK" sets the SDKROOT variable. “基本SDK”设置SDKROOT变量。

See "Cross-develop using target sdk" 请参阅“使用目标SDK交叉开发”

And "Cross-Development Programming Guide" 和《跨开发编程指南》

As pointed out, a caveat is optimizing, mem-leaking and so forth. 如前所述,警告是优化,内存泄漏等。

STEP 2. (Pain in the *ss) 步骤2。(在* ss中痛苦)

Then, you will have to start peppering your code with precompiler if statements. 然后,您将必须开始使用precompiler if语句添加代码。

#if __IPHONE_OS_VERSION_MAX_ALLOWED >= 40000
if ( [[[ UIDevice currentDevice] systemVersiuon] floatValue] > = 4.0 ) {

    ...something available in 4.0
}
#endif

This precompiler braches should be in there to support multiple devices, no matter the XCode case. 无论XCode是哪种情况,该预编译器分支都应该位于其中以支持多个设备。

if you make an app for iOS 4.0 it should work with iOS 4.3 and iOS5. 如果您为iOS 4.0制作应用,则它应可与iOS 4.3和iOS5一起使用。 But for Xcode 4.2 you don't need Lion, Snow Leopard is enough(I've heard that Lion isn't that good compared to Snow Leopard). 但是对于Xcode 4.2,您不需要Lion,Snow Leopard就足够了(我听说Lion与Snow Leopard相比还不够好)。

You cannot use Xcode 3.1 to develop apps the use SDK APIs or features new to iOS 4.3 or 5.x, or to debug apps running on devices with those later OS versions. 您不能使用Xcode 3.1来开发使用SDK API或iOS 4.3或5.x新增功能的应用程序,也不能调试在具有更高版本OS的设备上运行的应用程序。

You can use Xcode 3.1 to develop apps that will run on devices with iOS 4.3 or 5.x by using Ad Hoc deployment and installing the apps via iTunes. 您可以使用Xcode 3.1通过Ad Hoc部署并通过iTunes安装应用程序来开发可在具有iOS 4.3或5.x的设备上运行的应用程序。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM