我有一个UISplitViewController
我的MasterViewController
有一个UITableViewController
。
我想在视图的底部添加一个iAd。我想我已经实现了这一点,但没有广告显示。
self.adBannerView = [[ADBannerView alloc] initWithFrame:CGRectZero];
self.adBannerView.frame = CGRectMake(0, self.view.frame.size.height - 50, 320, 50);
[self.view addSubview:self.adBannerView];
//set proper bottom inset depending on your banner height
self.tableView.contentInset = UIEdgeInsetsMake(0, 0, 50, 0);
adBannerView.delegate = self;
我已经实现了委托方法:
- (void)bannerViewDidLoadAd:(ADBannerView *)banner
{
if (!_bannerIsVisible)
{
// If banner isn't part of view hierarchy, add it
if (adBannerView.superview == nil)
{
[self.view addSubview:adBannerView];
}
[UIView beginAnimations:@"animateAdBannerOn" context:NULL];
// Assumes the banner view is just off the bottom of the screen.
// banner.frame = CGRectOffset(banner.frame, 0, -banner.frame.size.height);
[UIView commitAnimations];
_bannerIsVisible = YES;
}
}
- (void)bannerView:(ADBannerView *)banner didFailToReceiveAdWithError:(NSError *)error
{
NSLog(@"Failed to retrieve ad MLEFT");
NSLog(@"MLEFT Error :%@",error);
if (_bannerIsVisible)
{
[UIView beginAnimations:@"animateAdBannerOff" context:NULL];
// Assumes the banner view is placed at the bottom of the screen.
// banner.frame = CGRectOffset(banner.frame, 0, banner.frame.size.height);
[UIView commitAnimations];
_bannerIsVisible = NO;
}
}
但广告没有显示。几个小时后也没等。在另一个视图中,广告已加载。
我在这里缺少什么?
答案 0 :(得分:0)