2

我正在以编程方式ADBannerView在我的 iPhone 应用程序中创建,

谁能这么说我

为什么我在控制台中收到此消息,

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

4

1 回答 1

4
in .h file 
#import <iAd/iAd.h>
@interface YOUR_FILE : UIViewController <ADBannerViewDelegate>{

 ADBannerView *adView;
}

@property(nonatomic,retain)IBOutlet ADBannerView *adView;

@end;

在 .m 文件中

 -(void)viewDidLoad  {

...
...
...
...
     adView.delegate =self;
    }

-(void) bannerView:(ADBannerView *)banner didFailToReceiveAdWithError:(NSError *)error 
{
    NSLog(@"iAdBanner failed");


}
-(void) bannerViewDidLoadAd:(ADBannerView *)banner
{

    NSLog(@"iAdBanner loaded");



}
于 2012-07-20T05:50:13.967 回答