Recently I integrated iADs into my project and while setting the size of the adBannerView to portrait or landscape, I used
[_adBannerView setCurrentContentSizeIdentifier: ADBannerContentSizeIdentifier480x32];
and
[_adBannerView setCurrentContentSizeIdentifier: ADBannerContentSizeIdentifier320x50];
This worked on the simulator, but I got warnings that the code was deprecated. So I changed the code to
[_adBannerView setCurrentContentSizeIdentifier: ADBannerContentSizeIdentifierLandscape];
and
[_adBannerView setCurrentContentSizeIdentifier: ADBannerContentSizeIdentifierPortrait];
and the warnings went away and i worked fine on my simulator.
However, when I tested out my app on my device(iOS 4.1), The GDB gives me a EXC_BAD_ACCESS error. When I switched back to the earlier code(480×32), the app works fine on my device.
So in a nutshell, my device can run apps which use deprecated iAD methods, and crashes when the current iAD methods are used.
Anyone know why? Also, will Apple reject my app if I use deprecated methods?
Thanks
if your device iOS version is less then 4.2, it will crash because there is no declaration for
ADBannerContentSizeIdentifierLandscapeandADBannerContentSizeIdentifierPortrait. You can do a check and see what version the iOS device has, and addADBannerContentSizeIdentifierPortraitandADBannerContentSizeIdentifierLandscapeonly if the version is 4.2 or higher, however you can safely useADBannerContentSizeIdentifier480x32andADBannerContentSizeIdentifier320x50.Here’s a sample on how you can do that: Check iPhone iOS Version