为什么下面的代码在iOS 6中工作正常?但是在iOS 5中,它陷入了导致设备崩溃的无限循环中。一旦行“self.footerView = ...”被执行,它会再次调用viewForFooterInSection。因此将其陷入无限循环。viewForFooterInSection陷入无限循环
- (UIView *)tableView:(UITableView *)tableView viewForFooterInSection:(NSInteger)section
{
if (!self.footerView)
self.footerView = [[UIView alloc] initWithFrame:[tableView rectForFooterInSection:section]];
return self.footerView;
}
有没有更好的方法来做到这一点?为什么这个工作在iOS 6而不是5?
问候,
彼得