I have ADBannerView created and deleted on ViewWillAppear and ViewWillDisappear separately, even though, after switching to another view that doesn't have ADBannerView created, I am still seeing tons of the warning. What does it mean? How can I fix it?
Asked
Active
Viewed 640 times
2 Answers
0
I had more success creating and setting up the adView either with IB or in viewDidLoad rather then viewWillAppear. Here is an example derived from code used in one of my apps. I hope that it helps.
- (void)viewDidLoad
{
[super viewDidLoad];
adView = [[AdBannerView alloc]initWithFrame:GCResctMake(0,0,320,50)];
adView.requiredContentSizeIdentifiers = [NSSet setWithObject:ADBannerContentSizeIdentifier320x50];
adView.currentContentSizeIdentifier = ADBannerContentSizeIdentifier320x50;
adView.delegate=self;
bannerIsVisible=NO;
adView.hidden = YES;
[adContainerView addSubview:adView];
[adView release];
}

Kibitz503
- 867
- 6
- 10
0
You really should just create a single AdBannerView object in your app, and reuse it across the your other views by adding/remove it dynamically as needed. You also have to handle the show/hide of it when there is or isn't an iAd available, and the resize of the content view to make room for displaying the subview. Take a look at the TabbedBanner project in the Apple iAdSuite sample which has a nice encapsulation of this functionality.

Squawky
- 304
- 2
- 7