Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/ios/121.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
如何在UITableView ios中重用已加载的标题视图_Ios_Uitableview - Fatal编程技术网

如何在UITableView ios中重用已加载的标题视图

如何在UITableView ios中重用已加载的标题视图,ios,uitableview,Ios,Uitableview,我试图在-(UIView*)tableView:(UITableView*)tableView view for headerinsection:(NSInteger)section上使用谷歌广告 实际上,我需要使用线程来显示广告,而不必使用线程来破坏应用程序 在UITableView的每个部分中,在20个单元格之后,我想显示广告 但我的问题是,每当我上下滚动时需要时间重新加载广告时,例如,如果我在第一节,则在我移动到第节后加载广告。在我再次返回第一节时加载广告。旧的广告视图被删除,新的广告视图

我试图在
-(UIView*)tableView:(UITableView*)tableView view for headerinsection:(NSInteger)section
上使用谷歌广告

实际上,我需要使用线程来显示广告,而不必使用线程来破坏应用程序

在UITableView的每个部分中,在20个单元格之后,我想显示广告

但我的问题是,每当我上下滚动时需要时间重新加载广告时,例如,如果我在第一节,则在我移动到第节后加载广告。在我再次返回第一节时加载广告。旧的广告视图被删除,新的广告视图正在加载

所以我想在这里,我想在第一节中重复使用旧的ads视图,只有第一次加载广告时,它才应该重复使用旧的ads视图。这是我在
viewForHeaderInSection

 [[NSOperationQueue mainQueue] addOperationWithBlock:^{

// Create a view of the standard size at the top of the screen.
// Available AdSize constants are explained in GADAdSize.h.
 adBanner_ = [[GADBannerView alloc] initWithAdSize:kGADAdSizeBanner];

// Specify the ad's "unit identifier." This is your AdMob Publisher ID.
adBanner_.adUnitID = @"a15120dbc353a5f";

// Let the runtime know which UIViewController to restore after taking
// the user wherever the ad goes and add it to the view hierarchy.
adBanner_.rootViewController = self;

// Initiate a generic request to load it with an ad.
[adBanner_ loadRequest:[GADRequest request]];

}];

return adBanner_;
请任何人告诉我如何重复使用第一,第二和第三。。。如果该剖面视图已加载,请重新创建剖面


谢谢

您找到解决方案了吗?我有同样的问题,请告诉我。