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控制台中显示未处理的错误所遇到的程序开发问题。
如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)