-(void)tableView:(UITableView *)tableView willDisplayHeaderView:(UIView *)view forSection:(NSInteger)section{
UITableViewHeaderFooterView *headerIndexText = (UITableViewHeaderFooterView *)view;
[headerIndexText.textLabel setTextColor:[UIColor whiteColor]];
}
上面的代码在iOS6和iOS7上运行良好,并且已经投入生产了一段时间。但是,在iPhone5S 模拟器上的iOS8上运行时,应用程序崩溃并出现以下错误:
-[UIView textLabel]:无法识别的选择器发送到实例 0xeccad20
这是为这个标签设置样式的一种已弃用的方法,还是 iOS8 中的一个错误?