0
votes

I have put iAd in my app and for some reason when I run it in the simulator, it causes an error.

ADBannerView: Unhandled error (no delegate or delegate does not implement didFailToReceiveAdWithError:): Error Domain=ADErrorDomain Code=0 "The operation couldn’t be completed. Unknown error" UserInfo=0x9258b10 {ADInternalErrorCode=0, ADInternalErrorDomain=ADErrorDomain, NSLocalizedFailureReason=Unknown error}

I have the frameworks and the header file done correctly, yet it does display advertisements and it sometimes gives this error

1

1 Answers

0
votes

You're getting this error because XCode can't find where your add is in your storyboard or .xib file. Also, your getting this error because you do not have the didFailToReciveAdWithError void. The code you should be using is below.

You don't need to do anything in your header file, just add the following code to your .m file:

-(void)bannerViewDidLoadAd:(ADBannerView *)banner {
  [UIView beginAnimations:nil context:NULL];
  [UIView setAnimationDuration:1];
  [banner setAlpha:1];
  [UIView commitAnimations];
}

- (void)bannerView:(ADBannerView *) banner didFailToReceiveAdWithError:error{ 
  [UIView beginAnimations:nil context:NULL];
  [UIView setAnimationDuration:1];
  [banner setAlpha:0];
  [UIView commitAnimations];
}

again, you don't need ANYTHING in your header file. Next go into your .xib or storyboard file, and get rid of any outlets, or anything else hooked up to you're banner views. Next, right click on your banner views and drag the Outlet delegate to the file's owner