您如何选择在 2.0 兼容应用程序中使用 iPhone OS 3.0 功能? [英] How do you optionally use iPhone OS 3.0 features in a 2.0 compatible app?

查看:14
本文介绍了您如何选择在 2.0 兼容应用程序中使用 iPhone OS 3.0 功能?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当 iPhone OS 3.0 在 3.0 设备上运行时,我想在我的 2.0 应用程序中使用它的一些功能.我不想一路走 3.0,因为有些客户还不想更新.

I'd like to use some features of iPhone OS 3.0 in my 2.0 app when it runs on a 3.0 device. I don't want to go 3.0 all the way because there are customers who do not want to update yet.

我尝试了 MapKit.framework (-weak_framework MapKit) 的弱链接.我发现它很麻烦,因为我不得不欺骗编译器/链接器来使用 2.0 SDK 的所有代码,除了使用 MapKit 的代码.

I experimented a bit with weak linking of the MapKit.framework (-weak_framework MapKit). I found it quite cumbersome, since I had to trick the compiler/linker to use the 2.0 SDK with all code except the one which uses MapKit.

有没有人有更多这方面的经验?你在做什么让它编译/链接.有没有人已经向苹果提交了一个应用程序,其中弱链接来自其他操作系统版本的框架?

Has anybody more experience with this? What are you doing to make it compile/link. Has anybody already submitted an app to Apple, which weak-links frameworks from other OS versions?

推荐答案

Apple 有一个示例说明如何做到这一点,特别是制作一个使用 MFMailComposeViewController 的 2.x 兼容应用程序....

Apple has an example of how to do this, specifically making a 2.x-compatible app that uses MFMailComposeViewController....

http://developer.apple.com/iphone/library/示例代码/MailComposer/index.html

答案涉及使用 3.0 SDK 进行编译,将部署目标设置为 2.x,确保将 3.0 框架标记为弱"引用,然后做正确的事情使您的代码正常工作(如果您正在使用)不存在新框架的设备.

the answer involves compiling with the 3.0 SDK, setting the deployment target to 2.x, ensuring that the 3.0 frameworks are marked as "weak" references, and then doing the right thing to make your code work if you're on a device where the new frameworks aren't present.

这篇关于您如何选择在 2.0 兼容应用程序中使用 iPhone OS 3.0 功能?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆