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