1

I am using iAds with banner views. The following code brings up the warning saying that the ad is obscured.

- (void)willAnimateRotationToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation duration:(NSTimeInterval)duration
{
    if (UIInterfaceOrientationIsPortrait(toInterfaceOrientation)) {

            _bannerView.currentContentSizeIdentifier = ADBannerContentSizeIdentifierPortrait;//WARNING SHOWN WHEN THIS STATEMENT EXECUTES

    } else {
        _bannerView.currentContentSizeIdentifier = ADBannerContentSizeIdentifierLandscape;

    }
    [self layoutAnimated:duration > 0.0];
}

Cannot figure out why the ad should be obscured when all I did was to change the interface orientation. Any clues appreciated.

1 Answer 1

2

Have you set following at first time when you create shared object of banner View??

If No , Then try this may this will help.

if (&ADBannerContentSizeIdentifierPortrait != NULL)
    {
       [_sharedBannerView setRequiredContentSizeIdentifiers:[NSSet setWithObjects:ADBannerContentSizeIdentifierPortrait, ADBannerContentSizeIdentifierLandscape, nil]];            
    }
else
    {  
                [_sharedBannerView setRequiredContentSizeIdentifiers:[NSSet setWithObjects:ADBannerContentSizeIdentifier320x50, ADBannerContentSizeIdentifier480x32, nil]];            
    }
1
  • Thanks but doesn't help. It shows the same error on the method for setRequiredContentSizeIdentifiers instead.
    – user542584
    Apr 2, 2012 at 10:04

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.