0

I have successfully implemented iAd into my App just this past week, but when my fill rate was very low I looked into it, and I realize I have a problem. My iAd banner is correclty displayed on the first screen the user sees, and that is the only screen on which the banner ad is displayed by my design. I setup a singleton class to manage the ads, and I'm expanding it to display on additional screens in an upcoming release. However, when I push another view controller to the front that doesn't display ads, my iAd delegate methods:

- (void)bannerViewDidLoadAd:(ADBannerView *)banner
- (void) bannerView:(ADBannerView *)banner didFailToReceiveAdWithError:(NSError *)error

are still being called every 3 minutes as though the view is active.

Is there a way to temporarily disable iAd from trying to refresh? thanks in advance.

Mick MacCallum
  • 129,200
  • 40
  • 280
  • 281
jpporterVA
  • 629
  • 2
  • 7
  • 20
  • Does hiding the iAd view using `UIView`'s `-setHidden:` work? – Constantino Tsarouhas Aug 06 '12 at 17:00
  • That doesn't work either - after 3 minutes the ad is refreshed, and the delegate routines are called. I guess I could release the ADBannerView object, but I want to be able to show the same ad if they come back before the 3 minute timer, so I don't want to do that just yet. – jpporterVA Aug 06 '12 at 17:32

1 Answers1

0

Since I'm not showing ads on all of the pages, I create/release the ad object when my view controller that is showing ads is displayed/not-displayed (and set the delegate to nil), and this prevents any ads/delegate functions on view controllers that are not currently displayed from being displayed.

jpporterVA
  • 629
  • 2
  • 7
  • 20