views:

734

answers:

1

As title described, I integrated iAd into my iPhone apps. Everything worked fine in the iPhone simulator (iOS4). However, when I try to install it on my iPhone(version 3.1.3), I got an error:

  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. When I comment out all the iAd related code, the apps installs with no problem.

There must be a way to do this, because I downloaded the apps "showtimes" and "Yellow Pages", which use iAd. Both apps run very well on my 3.1.3 phone, and I can see the iAd as well.

Does anybody know how to do this?

+2  A: 

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". 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.

warrenm
nice. that's it. thanks!
David