0

I have the following code for iAds.

[_iAdAdView setCurrentContentSizeIdentifier:ADBannerContentSizeIdentifierPortrait];

But this code throws "EXC_BAD_ACCESSS" in iOS 4.0 and iOS 4.1 devices.

The doc says that it is available from iOS 4.0 and later http://developer.apple.com/library/ios/#documentation/userexperience/Reference/ADBannerView_Ref/Reference/Reference.html

So why does the code crash for iOS 4.0 and iOS 4.1 and not for iOS 4.2 and later.

How do I work around to set the required settings for iOS 4.0 and iOS 4.1.

EDIT: I found the solution in the source code AdBannerView.h, and noticed that "ADBannerContentSizeIdentifierPortrait" is availabled only in iOS 4.2

Anand
  • 4,182
  • 6
  • 42
  • 54
  • EXC_BAD_ACCESS doesn't mean that the code is not supported or doesn't exist in that version, it means that the _iAdAdView object is over-released or not present any more or not initialized. – jrturton Nov 22 '11 at 07:54
  • it 'indicates' so when the code works on one OS version and not on another. – Anand Nov 22 '11 at 08:01

2 Answers2

2

This is what the documentation says

The identifier placed in the currentContentSizeIdentifier property must be included in the set of identifiers stored in the requiredContentSizeIdentifiers property. This ensures that an advertisement displayed by the view can still be displayed after the view’s size changes. Setting a value not included in the requiredContentSizeIdentifiers property causes an exception to be thrown.

Check out the bold part. That is what might be causing the exception.

lostInTransit
  • 70,519
  • 61
  • 198
  • 274
  • you are right, have posted a related question then http://stackoverflow.com/questions/8223763/adbannercontentsizeidentifier320x50-deprecated-now-what – Anand Nov 22 '11 at 08:15
0

I found the solution in the source code AdBannerView.h, and noticed that "ADBannerContentSizeIdentifierPortrait" is availabled only in iOS 4.2

Anand
  • 4,182
  • 6
  • 42
  • 54