使用 iOS 4.0 SDK 和设备开发 iOS 3.1 应用程序?
我为 iOS 部署目标 3.2 开发了一个 iPhone 应用程序。
但我的客户改变了主意,希望该应用程序适用于 iOS 3.1。 因此,我设置了 iOS 部署目标 3.1 并将基础 SDK 保留为 4.0,但一切都可以正常编译,而我确信我仅使用 iOS 3.2 中引入的方法和类。
如何识别无法在 3.1 设备上运行的代码? (并且可能导致应用程序崩溃)
我的问题是我有一个 iPhone 设备(安装了 4.0.2)并且 Xcode 不再提供 SDK 3.1.x。
I've developed an iPhone application for an iOS Deployment Target 3.2.
But my client changed his mind and would like the app to be available for iOS 3.1.
Thus, i've set iOS Deployment Target 3.1 and left base SDK to 4.0 but everything compiles fine whereas I'm sure I use methods and classes introduced in iOS 3.2 only.
How can I identify my code that won't run on a 3.1 device ? (and may cause an application crash)
My problem is that I have a single iPhone device (with 4.0.2 installed) and that SDK 3.1.x are not provided by Xcode anymore.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
亨利,这可能对你有帮助:安装旧的 xcode & sdk 与新的并行。可以在此处找到旧 SDK 的链接:
http://iphonesdkdev.blogspot.com/2010/ 04/old-versions-of-iphone-sdk.html
希望,这就是您想要的。
Henry, this might help you: install the old xcode & sdk parallel to the new one. Links to the old SDKs can be found here:
http://iphonesdkdev.blogspot.com/2010/04/old-versions-of-iphone-sdk.html
hope, that was what you wanted.
您也检查过警告吗?如果找不到选择器,那么它将编译,但可能会向您发出警告,指出未找到匹配的选择器或类似的内容。你说你确定你用过>=3.2的东西。你不知道它们是什么吗?
Have you checked the warnings too? If a selector is not found then it will compile but may give you a warning that matching selector is not found or something similar. You said that you are sure that you have used >=3.2 things. Don't you know what are they?
确保您的应用程序能够在运行 3.1 的设备上运行的唯一方法是在运行 3.1 的设备上对其进行测试。对较旧(iPhone 3G S 之前)硬件的支持也是如此。我在商店里见过太多的应用程序,这些应用程序显然只在较新的设备上进行了测试,而在较旧的硬件上却陷入困境或内存不足。如果您不支持该硬件,那就太好了,只需适当设置您的 Info.plist 以使其不适用于这些设备。
无论您认为自己已经检查了新的方法和类得多么彻底,您仍然可能会遇到一些微妙的问题。例如,您可能需要也可能不需要弱链接某些框架,否则即使您不使用任何新的 API,您的应用程序也会在旧操作系统上崩溃。
较旧型号的 iPod touch 在 eBay 上很便宜,如果已安装 4.0,则可以降级到较旧的操作系统版本。或者,您可以找到拥有运行较旧操作系统版本的设备的人,并向他们发送应用程序的临时版本以进行测试。这是不太理想的,因为您需要将 Instruments 连接到设备,以确保内存使用量不会太接近旧设备上的危险区域。
抱歉,但这是唯一可以确定的方法。正如另一位开发人员对我所说,“如果您尚未在特定操作系统版本或设备上测试它,请考虑您的应用程序不在那里运行。”
The only way you can be sure that your application will work on a device running 3.1 is to test it on a device running 3.1. The same goes for support of older (pre-iPhone 3G S) hardware. I've seen far too many applications on the store that were clearly tested only on a newer device and which bog down or run out of memory on older hardware. If you don't support that hardware, great, just set your Info.plist appropriately to not make it available to those devices.
No matter how thoroughly you think you've checked for newer methods and classes, you can still run into subtle issues. For example, you may or may not need to weak link certain frameworks or your application will crash on older OSs, even if you don't use any new APIs.
Older model iPod touches are cheap on eBay and can be downgraded to the older OS versions if 4.0 has been installed on them. Alternatively, you can find someone with a device running an older OS version and send them an ad hoc build of the application to test. This is less desirable, because you'll want to hook up Instruments to the device to make sure memory usage is not getting too close to the danger area on the older device.
I'm sorry, but that's the only way to be sure. As another developer said to me, "If you haven't tested it on a specific OS version or device, consider your application to not run there."