title: Trying to use iAds as a Class
body: <p>I am am implementing iAds, I have followed a lot of tutorials but couldn't find any that I think did it in a smart way.
  I have multiple view controllers on which I want to display ads, so I have create a class for ads my .m file looks like this:</p>
  
  <pre><code>#import "AdBanner.h"
  #import "AppDelegate.h"
  
  @implementation AdBanner
  
  
  - (AppDelegate*)appdelegate {
      return (AppDelegate *)[[UIApplication sharedApplication] delegate];
  }
  
  
  //in view will appear
  -(void)initializeBottomADinView:(UIView*)view{
      _UIiAD = [[self appdelegate]UIiAD];
      _UIiAD.delegate = self;
      [_UIiAD setFrame:CGRectMake(0,view.frame.size.height-50,320,50)];
      [view addSubview:_UIiAD];
  
  }
  
  //in viewWillDisappear
  -(void)removeAd{
      _UIiAD.delegate=nil;
      _UIiAD=nil;
      [_UIiAD removeFromSuperview];
  }
  
  - (void)bannerViewDidLoadAd:(ADBannerView *)banner{
      NSLog(@"successfully loaded ad");
      [UIView beginAnimations:@"animateAdBannerOff" context:NULL];
  
      _UIiAD.alpha = 1;
      [UIView commitAnimations];
  }
  
  
  
  
  
  
  - (void)bannerView:(ADBannerView *)banner didFailToReceiveAdWithError:(NSError *)error
  {
  //remove ad
      NSLog(@"failed to load ad");
      [UIView beginAnimations:@"animateAdBannerOff" context:NULL];
      _UIiAD.alpha = 0;
      [UIView commitAnimations];
       [_UIiAD removeFromSuperview];
  }
  </code></pre>
  
  <p>So in each view controller I want ads to be in I just call the method "initializeBottomAdInView:self.view".
  This way I don't have to copy the delegate again and again.</p>
  
  <p>The problem is that the delegate methods "bannerViewDidLoadAd" and  "bannerViewDidFail" seem to be loaded only once.Therefor once an ad wasn't loaded the banner is hidden and since the delegate is not run again even if the banner is loaded, it won't show again.</p>
  
  <p>If anyone has good practice for using ads as a method, rather than adding the same code in every view controllers, that would be awesome to share it.</p>
  
  <p>Thank you,</p>