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.
一,经历
<1> 使用SDWebImage下载 成功图片后,将图片设置给 self.imageView.image,提示如题所示的错误提示.
<2>第一反应就是慢慢注释掉代码进行调试,结果发现是在成功的回调中出事了,代码如下:
- (void)setupDownloadImage{
NSURL *url = [NSURL URLWithString:@"http://i4.pdim.gs/dmfd/200_200_100/t01f117f76fc58c257c.gif"]; SDWebImageDownloader *downloader = [SDWebImageDownloader sharedDownloader];
[downloader downloadImageWithURL:url options: progress:nil completed:^(UIImage *image, NSData *data, NSError *error, BOOL finished) {
if (data != nil && image != nil) {
UIImage *image = [UIImage sd_animatedGIFWithData:data];
self.imageView.image = image;
}else {
UIImage *image = [UIImage imageNamed:@""];
self.imageView.image = image;
}
}];
}
<3>初步怀疑是sdwebimage 设置gift 图片失败,就在成功的回调中使用了一张本地的图片,依旧报错.
<4>仔细研究了提示,发现了关键词"a background thread",才知道是 sdwebimage 的后台线程在执行一些操作,仔细想了想才知道是更新 UI的操作必须在主线程中执行.
二,总结
<1>一定要注意子线程中对更新 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.的更多相关文章
- This application is modifying the autolayout engine from a background thread, which can lead to engine corruption and weird crashes.
-- :::] This application is modifying the autolayout engine from a background thread, which can lead ...
- This application is modifying the autolayout engine from a background threa-线程错误
警告提示:This application is modifying the autolayout engine from a background thread, which can lead to ...
- warning:This application is modifying the autolayout engine from a background thread
警告提示:This application is modifying the autolayout engine from a background thread, which can lead to ...
- iOS之崩溃处理:This application is modifying the autolayout engine from a background thread
一.错误提示 今天在开发的时候遇到一个崩溃问题,"This application is modifying the autolayout engine from a background ...
- iOS开发——modifying the autolayout engine from a background thread
很多时候,我们需要用到多线程的东西,比如红外线检测是否有人经过.这种情况需要搞个子线程在后台不断的检测,这个线程可能是第三方提供的,你调用它给的方法,然后显示提示框的时候,问题就来了. 提示信息:Th ...
- APP崩溃提示:This application is modifying the autolayout engine from a background thread after the engine was accessed from the main thread. This can lead to engine corruption and weird crashes.
崩溃输出日志 2017-08-29 14:53:47.332368+0800 HuiDaiKe[2373:1135604] This application is modifying the auto ...
- iOS 报错:(子线程中更新UI)This application is modifying the autolayout engine from a background thread after the engine was accessed from the main thread. This can lead to engine corruption and weird crashes.
今天在写程序的时候,使用Xcode 运行工程时报出下面的错误错信息,我还以为是什么呢,好久没遇到过这样的错误了. **ProjectName[1512:778965] This application ...
- autolayout也会锁死
This application is modifying the autolayout engine from a background thread, which can lead to engi ...
- iOS JavaScriptCore与H5交互时出现异常提示
在利用JavaScriptCore与H5交互时出现异常提示: This application is modifying the autolayout engine from a background ...
随机推荐
- 【openGL】关于画点
#include "stdafx.h" #include <GL/glut.h> #include <stdlib.h> #include <math ...
- maven错误解决一:Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:2.5.1:compile (default-compile)
解决方法是将 jre的目录在 window->Preferences 里修改java installed里的jre目录改为jdk目录即可. 原因是在jre目录下不存在tools.jar.
- 在Asp.Net MVC中实现CompareValues标签对Model中的属性进行验证
在Asp.Net MVC中可以用继承ValidationAttribute的方式,自定制实现Model两个中两个属性值的比较验证 具体应用场景为:要对两个属性值的大小进行验证 代码如下所示: /// ...
- HDU 2243 考研路茫茫——单词情结(AC自动机+矩阵)
考研路茫茫——单词情结 Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total ...
- 创建对象为什么要 init?
self 为什么要赋值为[super init]:”,当程序进入到init这个方法的时候,系统已经生成了对象并分配了存储空间,在调用[super init]是为了初始化父类对象,在父类对象初始化过程序 ...
- 遍历进程活动链表(ActiveProcessLinks)、DKOM隐藏进程
1.EPROCESS结构体 EPROCESS块来表示.EPROCESS块中不仅包含了进程相关了很多信息,还有很多指向其他相关结构数据结构的指针.例如每一个进程里面都至少有一个ETHREAD块表示的线程 ...
- Android源码学习之模板方法模式应用
一.模板方法模式定义 模板方法模式定义: defines the skeleton of an algorithm in a method, deferring some steps to subcl ...
- Sql数据库帮组类
这段时间闲下来写了一些东西,重新写了一个简单的数据库帮组类 public class MyDBHelper { public static readonly string connString = C ...
- Android拓展系列(10)--使用Android Studio阅读整个Android源码
之前一直在windows下用source insight阅读android源码,效果非常好.后来远程异地服务器,网络限制,一直用ssh + vim,现在主要还是以这种方式.最近发现一个不错的东西(早就 ...
- css:删除:×的效果
常常要使用的显示删除效果: DEMO