title: iAds: How can I prevent my AdBannerView delegate from getting called after the view has been released?
body: <p>I'm adding iAds to my app and it's crashing because the AdBannerView delegate gets called after the view is released.  I'm following the code examples in the Apple docs, as well as code samples I've found on the Apple Dev forums, but I'm missing something because it's crashing.  </p>
  
  <p>I create the AdBannerView in the viewDidLoad of the view I want display it in...</p>
  
  <pre><code>self.bannerIsVisible = NO;
  self.adView = [[ADBannerView alloc] initWithFrame:CGRectMake(0, 0, 1024, 66)];
  adView.requiredContentSizeIdentifiers = [NSSet setWithObject:ADBannerContentSizeIdentifierLandscape];
  adView.currentContentSizeIdentifier = ADBannerContentSizeIdentifierLandscape;
  adView.delegate = self;
  [self.view addSubview:adView];
  </code></pre>
  
  <p>I bring it to the front in the viewDidAppear...</p>
  
  <pre><code>[self.view bringSubviewToFront:[self adView]];
  adView.frame = CGRectMake(0.0, 0.0, adView.frame.size.width, adView.frame.size.height);
  </code></pre>
  
  <p>I set it to nil in the viewDidUnload...</p>
  
  <pre><code>[[self adView] setDelegate:nil];
  [self setAdView:nil];
  </code></pre>
  
  <p>and I release it in dealloc...</p>
  
  <pre><code>[adView release];
  </code></pre>
  
  <p>Yet, every now and then, the app crashes with this error...</p>
  
  <pre><code>-[MyViewController bannerView:didFailToReceiveAdWithError:]: message sent to deallocated instance 0xf61d820
  </code></pre>
  
  <p>What am I missing?</p>
  
  <p>Thanks so much for your wisdom!</p>