我的代码如下所示,如入门指南中所述,请参阅链接: http ://help.mopub.com/customer/portal/articles/82831-start-guide
- (void)viewDidLoad {
self.adView = [[MPAdView alloc] initWithAdUnitId:@"xxx" size:MOPUB_BANNER_SIZE];
self.adView.delegate = self;
self.adView.frame = CGRectMake(0, self.view.bounds.size.height - MOPUB_BANNER_SIZE.height, MOPUB_BANNER_SIZE.width, MOPUB_BANNER_SIZE.height);
self.adView.keywords = keywords;
[self.view addSubview:self.adView];
[self.adView loadAd];
[super viewDidLoad];
}
问题是当我启动应用程序时,它将启动加载广告的 viewDidLoad 函数。当网络非常慢或不存在时,广告的加载将冻结应用程序的执行约 20 秒。这是不可接受的行为。有解决方案吗?