[英]How to make an iAd integrated iPhone app working on previous versions of iPhone OS?
As title described, I integrated iAd into my iPhone apps. 如标题所述,我将iAd集成到我的iPhone应用程序中。 Everything worked fine in the iPhone simulator (iOS4). 一切都在iPhone模拟器(iOS4)中运行良好。 However, when I try to install it on my iPhone(version 3.1.3), I got an error: 但是,当我尝试在我的iPhone(版本3.1.3)上安装它时,我收到一个错误:
dyld: Library not loaded: /System/Library/Frameworks/iAd.framework/iAd
Referenced from: /var/mobile/Applications/...
Reason: image not found
I already properly set the deployment target to v3.0, and base SDK to 4.0. 我已经将部署目标正确设置为v3.0,并将SDK基础设置为4.0。 When I comment out all the iAd related code, the apps installs with no problem. 当我注释掉所有与iAd相关的代码时,应用程序安装没有问题。
There must be a way to do this, because I downloaded the apps "showtimes" and "Yellow Pages", which use iAd. 必须有办法做到这一点,因为我下载了使用iAd的应用程序“showtimes”和“Yellow Pages”。 Both apps run very well on my 3.1.3 phone, and I can see the iAd as well. 这两个应用程序在我的3.1.3手机上运行得非常好,我也可以看到iAd。
Does anybody know how to do this? 有人知道怎么做这个吗?
To get past the loader error, double-click your target in Xcode and change the link type of the iAds.framework to "Weak" instead of "Required". 要超越加载程序错误,请在Xcode中双击目标,并将iAds.framework的链接类型更改为“Weak”而不是“Required”。 You'll probably have to do some conditional coding to support other ad networks as well, because iAds are not supported on pre-4.0 systems. 您可能还需要进行一些条件编码以支持其他广告网络,因为4.0之前的系统不支持iAd。
In xCode 4 select "Targets"-"Build Phases"- "Link Binary With Libraries". 在xCode 4中选择“Targets” - “Build Phases” - “Link Binary with Libraries”。 Change the link type of the iAd.framework to "Optional" instead of "Required". 将iAd.framework的链接类型更改为“Optional”而不是“Required”。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.