开发者

iOS 4.0 v 4.2 AdMob Issue: Attempt to run on device breaks on ADBannerContentSizeIdentifierPortrait

I am working on iOS app with Google AdMob SDK 3. The AdMob SDK contains the following code:

kADBannerContentSizeIdentifierPortrait =
    &ADBannerContentSizeIdentifierPortrait != nil ?
    ADBannerContentSizeIdentifierPortrait :
    ADBannerContentSizeIdentifier320x50;

I understand that ADBannerContentSizeIdentifier320x50 is deprecated in iOS 4.2 and later. I need my app to be compatible down to iOS 4.0.

When I build this code against iOS 4.0 SDK on the simulator, all goes fine. When I build against iOS 4.0 for device, I get the following error:

'ADBannerContentSizeIdentifierPortrait' undeclared

Why is this? I 开发者_开发百科understand that AdMob implemented this code specifically to get around the issue of ADBannerContentSizeIdentifier320x50 being deprecated in favour of ADBannerContentSizeIdentifierPortrait.. so why doesn't it work? Any thoughts?

Thanks.


If you are using Xcode 4.5. They have moved the declarations and you now need to add the line:

#import <iAd/iAd.h>


You have to build with your "Base SDK" set to 4.2 or higher ("Latest iOS" will work) and your "iOS Deployment Target" set to 4.0 so it will run on your phone. Setting the "Base SDK" to 4.0 will not work, because those symbols are not defined in SDK 4.0.


i am using Xcode 4.5 i have same problem what u mentioned above.

after i added #import this header file i am facing another issue below here

ld: warning: ignoring file /Development/stalin/Working/ComicsheadLite1.5/iAd.framework/iAd, missing required architecture i386 in file /Development/stalin/Working/ComicsheadLite1.5/iAd.framework/iAd (2 slices) Undefined symbols for architecture i386: "_ADBannerContentSizeIdentifierPortrait", referenced from: -[P_ExpressViewController addBannerView] in P_ExpressViewController.o "_OBJC_CLASS_$_ADBannerView", referenced from: objc-class-ref in P_ExpressViewController.o ld: symbol(s) not found for architecture i386 clang: error: linker command failed with exit code 1 (use -v to see invocation)

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜