gpt4 book ai didi

iphone - 广告 "no delegate or delegate does not implement didFailToReceiveAdWithError:"

转载 作者:行者123 更新时间:2023-12-03 19:31:58 30 4
gpt4 key购买 nike

我在禁用 wifi 的情况下运行我的应用程序,但调试器中总是出现空白和此消息:

ADBannerView:未处理的错误(没有委托(delegate)或委托(delegate)未实现 didFailToReceiveAdWithError:):错误域=ADErrorDomain代码=5“操作无法完成。横幅 View 可见,但没有内容”UserInfo=0x9632d30 {ADInternalErrorCode =5、NSLocalizedFailureReason=横幅 View 可见,但没有内容}

请帮我修复我的代码:.h

#import <iAd/iAd.h>
@interface ViewController : UIViewController <GKAchievementViewControllerDelegate, GameCenterManagerDelegate , ADBannerViewDelegate> {


//iAD
ADBannerView *banner;
}

//iAD
@property (nonatomic, assign) BOOL bannerIsVisible;
@property (nonatomic, retain) IBOutlet ADBannerView *banner;

.m

@synthesize  banner , bannerIsVisible;
-(void)bannerViewDidLoadAd:(ADBannerView *)abanner {
if (!self.bannerIsVisible) {
[UIView beginAnimations:@"animatedAdBannerOn" context:NULL];
banner.frame = CGRectOffset(banner.frame, 0.0, 50.0);
[UIView commitAnimations];
self.bannerIsVisible = YES;
}}

-(void)bannerView:(ADBannerView *)aBanner didFailToReceiveAdWithError:(NSError *)error {
if (!self.bannerIsVisible) {
[UIView beginAnimations:@"animatedAdBannerOff" context:NULL];
banner.frame = CGRectOffset(banner.frame, 0.0, -50.0);
[UIView commitAnimations];
self.bannerIsVisible = NO;
}

}

最佳答案

根据错误的委托(delegate)部分。在您的 viewDidLoad (或您初始化的任何地方)方法中设置 banner.delegate = self;

关于iphone - 广告 "no delegate or delegate does not implement didFailToReceiveAdWithError:",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11705090/

30 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com