iphone - 获取 ADBannerView 错误消息

标签 iphone objective-c ios

我正在以编程方式在我的 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}

最佳答案

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");



}

关于iphone - 获取 ADBannerView 错误消息,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11573449/

相关文章:

iphone - 将位置存储为字符串,从字符串中获取位置以显示在 map 上。 iOS

ios - 如何在 objective-c 中对数组元素进行这种格式转换

objective-c - react native 桥接 : Passing JSON to Swift function

ios - 如何在 Swift 中导入 FBSession.h

iphone - 如何在 UITextView 中加粗文本?

ios - 在 cordova ios iphone 中转换为 base64 时图像缩小

iOS 11 导航栏/uibarbutton 项目呈现问题

iphone - UIActivityViewController 不解雇

ios - meteor 应用程序 : Difference Between Uploading Images from Iphone than Computer?

iphone - iOS/openGL ES - 重写 drawRect 似乎会使 openGL 函数 "glGetRenderbufferParameterivOES"行为不当?