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中获取它,因为它尚未显示。