0

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(480x32), 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

Duck
  • 34,902
  • 47
  • 248
  • 470
Aravind
  • 284
  • 1
  • 4
  • 10
  • 1
    You should check this out: http://stackoverflow.com/questions/6698963/iad-bannerview-contentsizeidentifier-portrait-or-320x50 There are two ways, both work fine. – JonasG Sep 17 '11 at 07:55
  • oops, my question was a repeat then, thanks for the link anyway! – Aravind Sep 17 '11 at 08:05

1 Answers1

1

if your device iOS version is less then 4.2, it will crash because there is no declaration for ADBannerContentSizeIdentifierLandscape and ADBannerContentSizeIdentifierPortrait. You can do a check and see what version the iOS device has, and add ADBannerContentSizeIdentifierPortrait and ADBannerContentSizeIdentifierLandscape only if the version is 4.2 or higher, however you can safely use ADBannerContentSizeIdentifier480x32 and ADBannerContentSizeIdentifier320x50.

Here's a sample on how you can do that: Check iPhone iOS Version

Community
  • 1
  • 1
alex-i
  • 5,406
  • 2
  • 36
  • 56
  • Thanks for the quick answer! Yes, it does make sense since this new method is available only in iOS version >= 4.2. I will probably check for the device iOS version at run-time and use the appropriate method accordingly. – Aravind Sep 17 '11 at 08:04