Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/sql-server-2005/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Objective c iAd底部UITableViewController不显示广告_Objective C_Tableview_Iad - Fatal编程技术网

Objective c iAd底部UITableViewController不显示广告

Objective c iAd底部UITableViewController不显示广告,objective-c,tableview,iad,Objective C,Tableview,Iad,我有一个UISplitViewController和一个UITableViewController的MasterViewController。 我想在视图的底部添加一个iAd。我想我已经做到了这一点,但没有广告的显示 self.adBannerView = [[ADBannerView alloc] initWithFrame:CGRectZero]; self.adBannerView.frame = CGRectMake(0, self.view.frame.size.height - 50

我有一个
UISplitViewController
和一个
UITableViewController
MasterViewController
。 我想在视图的底部添加一个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;
    }

}
但广告没有播出。也不是经过几个小时的等待。在另一个视图中,将加载广告

我错过了什么

  • 确保已在**构建阶段=>将二进制文件链接到库中添加了iAd.framework
  • 如果您使用的是故事板,请检查ADBannerView是否位于任何其他视图的后面。(我建议尝试在所有视图前面放置0,0位置进行测试)