您的位置:首页 > 移动开发 > IOS开发

ios添加缓存后界面刷新崩溃问题

2015-11-04 10:48 471 查看
最近对程序数据做了缓存,读取缓存的操作在后台线程执行,在读取完之后直接使用delegate刷新界面,界面出现严重卡顿,查看控制台输出日志看到如下问题:

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.

出现该问题主要是因为刷新界面需要在住线程中进行,于是将刷新界面操作放在

dispatch_async(dispatch_get_main_queue(), ^{
[_tableView reloadData];
});

问题解决,以后还要多多学习啊!!!
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: