iPhone:根据ios版本管理框架 [英] iPhone: Manage frameworks according to ios versions

查看:122
本文介绍了iPhone:根据ios版本管理框架的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在我的iPad应用程式中,

In my iPad App,

我已经为twitter编写程式码。

I have done coding for twitter.

4.1,4.2和4.3。

For ios version 4.0,4.1,4.2 and 4.3.

ios版本5.0。

I have done separate coding for twitter.


if([[[UIDevice currentDevice] systemVersion] floatValue]>=5.0)

$ b b

像这样。

like this.

问题是当我运行代码在ios 4.x它崩溃

The problem is when I run the code in ios 4.x it crashes

结果无法加载我在XCode中包含的twitter框架。

因此,如何管理此框架在我的应用程序中。

So, How do I manage this frameworks in my app.

它的部署目标是4.0。

It's Deployement Target is 4.0.

它的Base SDK是5.0。

It's Base SDK is 5.0.

推荐答案

您必须检查Twitter.framework是否链接可选。转到您的目标,选择Bild Phases,选择链接二进制库和选择可选在Twitter.framework。

You must check that the Twitter.framework is linked "optional". Go to You Target, choose "Bild Phases", select "Link Binary With Libraries" and selection "Optional" at the Twitter.framework.

检查截图:

在你的代码中,你可以通过调用来检查Twitter框架是否在这里:

The in you code, you can check if the Twitter Framework is here by calling:

if(NSClassFromString(@"TWRequest") != NULL) {
  // Yes. Twitter Framework loaded
}

这篇关于iPhone:根据ios版本管理框架的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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