title: Implementing iAds Correctly in iOS7
body: <p>I have implemented iAds into my app, but I'm getting very odd errors when I run the app on the simulator. They tend to vary, but the most common error is <code>Error in Loading Banner!  Error Domain=ADErrorDomain Code=4 "The operation couldn’t be completed. Application has iAd Network configuration error" UserInfo=0xa368250 {ADInternalErrorCode=4, ADInternalErrorDomain=ADErrorDomain, NSLocalizedFailureReason=Application has iAd Network configuration error}</code></p>
  
  <p>And lately:
  <code>Error Domain=ADErrorDomain Code=5 "The operation couldn’t be completed. Banner view is visible but does not have content" UserInfo=0xa3a0c40 {ADInternalErrorCode=5, ADInternalErrorDomain=ADErrorDomain, NSLocalizedFailureReason=Banner view is visible but does not have content}</code></p>
  
  <p>I can't figure out why this is happening. I double checked to make sure that the simulator is connected to wifi, and the clock is correctly set as well. This is how I implemented iAds:</p>
  
  <p>Relevant code in the .h:</p>
  
  <pre><code>    #import "iAd/ADBannerView.h"
      @interface myViewController : UIViewController &lt;ADBannerViewDelegate&gt; {
      ADBannerView *adView;
  }
      @property (nonatomic, retain) IBOutlet ADBannerView *adView;
  </code></pre>
  
  <p>And all the relevant code in my .m:</p>
  
  <pre><code>@synthesize adView;
  ...
  - (void)viewDidLoad {
  
      adView.delegate = self;
      adView.hidden = YES;
  
      [super viewDidLoad];
  }
  ...
  -(void)bannerView:(ADBannerView *)banner
  didFailToReceiveAdWithError:(NSError *)error{
      NSLog(@"Error in Loading Banner!  %@", error);
  }
  
  -(void)bannerViewDidLoadAd:(ADBannerView *)banner{
      NSLog(@"iAd banner Loaded Successfully!");
  }
  -(void)bannerViewWillLoadAd:(ADBannerView *)banner{
      NSLog(@"iAd Banner will load!");
  }
  -(void)bannerViewActionDidFinish:(ADBannerView *)banner{
      NSLog(@"iAd Banner did finish");
  
  }
  </code></pre>
  
  <p>Then I dragged an AdBannerView onto the view and connected the outlets in the view controllers. <strong>Is this the correct way to do this?</strong> If so, what could be causing this error? The app doesn't crash... the ads simply don't appear. Supposedly this is a common issue but I could never track down a fix.</p>
  
  <p>I have enabled push notifications for my provisioning profile, and tried to find a section for iAds but could not. Could this be the issue?</p>
  
  <p>I've also ensured that the AdBannerView that I'm using is exactly 320x50. I tried again this morning with the same code and it's the same issue. Should I just go ahead and assume it's an Apple / iAd issue and submit my app assuming the above is implemented correctly?</p>