Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/objective-c/26.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
Ios 共享iAd横幅不';不显示在表视图之间_Ios_Objective C_Uitableview_Iad - Fatal编程技术网

Ios 共享iAd横幅不';不显示在表视图之间

Ios 共享iAd横幅不';不显示在表视图之间,ios,objective-c,uitableview,iad,Ios,Objective C,Uitableview,Iad,基于上的教程,我实现了共享iAd横幅视图,以显示两个表的标题位置之间的位置。导航控制器下有两个表控制器。横幅视图显示在第一个表中,但不显示在下一个表中 与我在UITableViewController中实现的代码相同 - (AppDelegate *) appdelegate { return (AppDelegate *)[[UIApplication sharedApplication] delegate]; } -(CGFloat)tableV

基于上的教程,我实现了共享iAd横幅视图,以显示两个表的标题位置之间的位置。导航控制器下有两个表控制器。横幅视图显示在第一个表中,但不显示在下一个表中

与我在UITableViewController中实现的代码相同

     - (AppDelegate *) appdelegate {
        return (AppDelegate *)[[UIApplication sharedApplication] delegate];
    }

     -(CGFloat)tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section{
      return 100.0;
    }

    -(void) viewWillAppear:(BOOL)animated{
        _UIiAD = [[self appdelegate] UIiAD];
        _UIiAD.delegate = self;

        [_UIiAD setFrame:CGRectMake(0,21,320,50)];
        [self.view addSubview:_UIiAD];
    }

    -(void) viewWillDisappear:(BOOL)animated{
        _UIiAD.delegate = nil;
        _UIiAD=nil;
        [_UIiAD removeFromSuperview];
    }

    -(void)bannerViewDidLoadAd:(ADBannerView *)banner{
        NSLog(@"ads loaded");
        [UIView beginAnimations:nil context:nil];
        [UIView setAnimationDuration:1];
        [_UIiAD setAlpha:1];
        [UIView commitAnimations];
    }

    -(void)bannerView:(ADBannerView *)banner didFailToReceiveAdWithError:(NSError *)error{
        NSLog(@"ads not loaded");
        [UIView beginAnimations:nil context:nil];
        [UIView setAnimationDuration:1];
        [_UIiAD setAlpha:0];
        [UIView commitAnimations];
    }