ios – ADBannerView控制台中显示未处理的错误

ios – ADBannerView控制台中显示未处理的错误,第1张

概述我按照苹果开发指南文档以编程方式在我的iOS应用程序上添加iAd.虽然我在stackoverflow上搜索了之前的解决方案,但不幸的是它们似乎都没有帮助我.有以下错误: iAdBanner failed [AppDeveloper] ADBannerView: Unhandled error (no delegate or delegate does not implement didFailTo 我按照苹果开发指南文档以编程方式在我的iOS应用程序上添加iAd.虽然我在stackoverflow上搜索了之前的解决方案,但不幸的是它们似乎都没有帮助我.有以下错误:

iAdBanner Failed [AppDeveloper] ADBannerVIEw: Unhandled error (no delegate or delegate does not implement dIDFailToReceiveADWithError:): Error Domain=ADErrorDomain Code=7 “The operation Couldn’t be completed. Ad was unloaded from this banner” UserInfo=0xb07b9a0 {ADInternalErrorCode=7,ADInternalErrorDomain=ADErrorDomain,NSLocalizedFailureReason=Ad was unloaded from this banner}. One thing worth mentioning that most of the time I get the message that iAdBanner loaded. here is the following code of my project SinglePlayerVIEwController.h

代码如下

#import <iAd/iAd.h>@interface SinglePlayerVIEwController : UIVIEwController <ADBannerVIEwDelegate>    {    ADBannerVIEw *adVIEw;    }

SinglePlaerVIEwController.m代码:

- (voID)vIEwDIDLoad    {        [super vIEwDIDLoad];        adVIEw = [[ADBannerVIEw alloc] initWithFrame:CGRectZero];        adVIEw.currentContentSizeIDentifIEr = ADBannerContentSizeIDentifIErPortrait;        CGRect adFrame = adVIEw.frame;        adFrame.origin.y = self.vIEw.frame.size.height-adVIEw.frame.size.height;        adVIEw.frame = adFrame;        adVIEw.delegate =self;        [self.vIEw addSubvIEw:adVIEw];    }-(voID) bannerVIEw:(ADBannerVIEw *)banner dIDFailToReceiveADWithError:(NSError *)error{    NSLog(@"iAdBanner Failed");}-(voID) bannerVIEwDIDLoadAd:(ADBannerVIEw *)banner{    NSLog(@"iAdBanner loaded"); }
解决方法 试试以下内容:
@interface SinglePlayerVIEwController : UIVIEwController<ADBannerVIEwDelegate>@property (nonatomic,retain) ADBannerVIEw *adVIEw;@end

- (voID)vIEwDIDLoad{    [super vIEwDIDLoad];    self.adVIEw = [[ADBannerVIEw alloc] initWithFrame:CGRectZero];    self.adVIEw.currentContentSizeIDentifIEr = ADBannerContentSizeIDentifIErPortrait;    CGRect adFrame = self.adVIEw.frame;    adFrame.origin.y = self.vIEw.frame.size.height-self.adVIEw.frame.size.height;    self.adVIEw.frame = adFrame;    self.adVIEw.delegate =self;    [self.vIEw addSubvIEw:self.adVIEw];}

HTH

总结

以上是内存溢出为你收集整理的ios – ADBannerView控制台显示未处理的错误全部内容,希望文章能够帮你解决ios – ADBannerView控制台中显示未处理的错误所遇到的程序开发问题。

如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。

欢迎分享,转载请注明来源:内存溢出

原文地址: http://outofmemory.cn/web/1102807.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2022-05-28
下一篇 2022-05-28

发表评论

登录后才能评论

评论列表(0条)

保存