问题:后台线程修改自动布局引擎
2016-07-18 18:46
351 查看
错误代码:
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.
原因:一个后台线程修改自动布局引擎,这可能导致引擎腐败和奇怪的崩溃
解决方法:把需要更新UI的放在的主线程就好了
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.
原因:一个后台线程修改自动布局引擎,这可能导致引擎腐败和奇怪的崩溃
解决方法:把需要更新UI的放在的主线程就好了
//在主线程上执行didThread:,waitUntilDone表示是否在当前线程等待该方法执行完成 [self performSelectorOnMainThread:@selector(didThread) withObject:@"11" waitUntilDone:NO];
- (void)didThread{ if ([NSThread isMainThread]) { NSLog(@"2.主线程"); //这里写主线程要写的代码 } }
相关文章推荐
- 设置网卡的mac地址
- 如何让iframe背景色透明
- Bitmap的加载和Cache
- HttpSessionActivationListener
- 我的一些简单的shell脚本实例
- 【java】反射机制
- ACM天梯赛 L2-014. 列车调度
- Android Hook机制之Binder Hook
- markov 模型概述
- ubuntu14.04下无法登录或循环登录的解决方法
- linux下usb抓包:wireshark+usbmon
- 基于zookeeper的远程方法调用(RMI)的实现
- HDU 1596 find the safest road(SPFA)
- 用VS2010编写的C++程序,在其他电脑上无法运行的问题
- SCAU Individual Contest #4(持续更新)
- Date、Calendar and SimpleDateFormat
- 行链接和行迁移
- Android 插件之Hook机制动态代理
- 说点什么,写在前面
- 列表中,时间的倒计时方法