我正在以编程方式在我的iPhone应用程序中创建ADBannerView
,
任何人都可以这样说,
为什么我在我的控制台中对此消息进行竞争,
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}
答案 0 :(得分:4)
in .h file
#import <iAd/iAd.h>
@interface YOUR_FILE : UIViewController <ADBannerViewDelegate>{
ADBannerView *adView;
}
@property(nonatomic,retain)IBOutlet ADBannerView *adView;
@end;
<。>文件中的
-(void)viewDidLoad {
...
...
...
...
adView.delegate =self;
}
-(void) bannerView:(ADBannerView *)banner didFailToReceiveAdWithError:(NSError *)error
{
NSLog(@"iAdBanner failed");
}
-(void) bannerViewDidLoadAd:(ADBannerView *)banner
{
NSLog(@"iAdBanner loaded");
}