我正在开发应用程序,我使用自定义的表格视图单元格来显示data.when,我的应用程序运行时会给出这个警告。
This application is modifying the autolayout engine from a background thread, which can lead to engine corruption and weird crashes. This will cause an exception in a future release我添加了一些断点,并查看了一下,现在是时候了。在这一点上(我调用客户表格视图单元格的时候到了)。
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
AirportTableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"identifier"];//in here it comes
ac = [detailArray objectAtIndex:indexPath.row];
cell.airportname.text = ac.airPort;
return cell;
}我试着用这个
dispatch_async(dispatch_get_main_queue(), ^{
// code here
});但是我不知道如何正确地使用它。有什么方法可以避免this.hope你的answers.thanx吗?
发布于 2015-12-18 19:11:50
cellForRowAtIndexPath:不应从后台线程调用。您可能正在从后台线程调用reloadData:或类似的东西,这是非常不健康的。
https://stackoverflow.com/questions/34354246
复制相似问题