depicus

changing the digital world one bit at a time...

Blants (noun) the rants of a blogger

  1. ‘Invalid content size ‘ADBannerContentSizeLandscape’ passed to ADAdSizeForBannerContentSize’

    June 21, 2011 by The Man

    If you are running an iPhone app on versions lower than 4.2 you may see this error ‘Invalid content size ‘ADBannerContentSizeLandscape’ passed to ADAdSizeForBannerContentSize’

    To fix (dirty) simply set the size when the view loads.

    - (void)viewDidLoad {
        if ([[[UIDevice currentDevice] systemVersion] doubleValue] < 4.2)
        {
            adMain.requiredContentSizeIdentifiers = [NSSet setWithObject:ADBannerContentSizeIdentifier320x50];
            adMain.currentContentSizeIdentifier = ADBannerContentSizeIdentifier320x50;
        }
        [super viewDidLoad];
    }