다음 코드는 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에서 작동하지 않는 이유는 무엇입니까?
감사합니다,
피터 rectForFooterInSection
뷰 프레임을 계산하기 위해 대리자 메서드 tableView:viewForFooterInSection:
를 호출 가능성이 높다