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.

user542584
  • 2,651
  • 2
  • 25
  • 29

1 Answers1

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]];            
    }
Neelam Verma
  • 3,232
  • 1
  • 22
  • 33
  • Thanks but doesn't help. It shows the same error on the method for setRequiredContentSizeIdentifiers instead. – user542584 Apr 02 '12 at 10:04