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
Objective c viewForFooterInSection未完成加载_Objective C_Uitableview_View_Footer - Fatal编程技术网

Objective c viewForFooterInSection未完成加载

Objective c viewForFooterInSection未完成加载,objective-c,uitableview,view,footer,Objective C,Uitableview,View,Footer,我试图在节页脚加载完成后直接更改其上的元素 但当我试着按照这个方法去做的时候 -(void)tableView:(UITableView *)tableView willDisplayFooterView:(UIView *)view forSection:(NSInteger)section { UITableViewHeaderFooterView* footerView = [self.tableView footerViewForSection:0]; } footerVie

我试图在节页脚加载完成后直接更改其上的元素

但当我试着按照这个方法去做的时候

-(void)tableView:(UITableView *)tableView willDisplayFooterView:(UIView *)view forSection:(NSInteger)section {

    UITableViewHeaderFooterView* footerView = [self.tableView footerViewForSection:0];
}
footerView返回零

唯一适合我的解决方案是performSelector:withObject:afterDelay

难道不应该存在一个类似于上面提到的委托方法,而是使用didDisplayFooterView吗


谢谢:

您的页脚视图作为参数视图传入。只需检查该部分是否为您想要的部分:

-(void)tableView:(UITableView *)tableView willDisplayFooterView:(UIView *)view forSection:   (NSInteger)section {

  if(section == 0) {
    //view is your footer view
  }
}
为什么不使用此方法中传递的view参数?willDisplayFooterView中的内容将在将来显示。当然,您无法从tableView中获取它,因为它尚未显示。