一,经历

<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.的更多相关文章

  1. 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 ...

  2. 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 ...

  3. 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 ...

  4. iOS之崩溃处理:This application is modifying the autolayout engine from a background thread

    一.错误提示 今天在开发的时候遇到一个崩溃问题,"This application is modifying the autolayout engine from a background ...

  5. iOS开发——modifying the autolayout engine from a background thread

    很多时候,我们需要用到多线程的东西,比如红外线检测是否有人经过.这种情况需要搞个子线程在后台不断的检测,这个线程可能是第三方提供的,你调用它给的方法,然后显示提示框的时候,问题就来了. 提示信息:Th ...

  6. 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 ...

  7. 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 ...

  8. autolayout也会锁死

    This application is modifying the autolayout engine from a background thread, which can lead to engi ...

  9. iOS JavaScriptCore与H5交互时出现异常提示

    在利用JavaScriptCore与H5交互时出现异常提示: This application is modifying the autolayout engine from a background ...

随机推荐

  1. Task使用小结

    Task是.NET推出数据任务处理的工作类,Task的使用也被越来越多的人讲解,这里仅仅介绍Task的部分使用介绍: 1.Task简单创建 --无返回值 Task.Factory.StartNew(( ...

  2. Parallel.js初探续集

    @author mrbean 例子均来源于github parallel.js 昨天写的第一篇今天一看居然有50+的阅读量了,感觉很激动啊,但是也有点害怕毕竟这只是自己笔记性质的一点东西,所以赶紧拿起 ...

  3. [Tools] 使用work2013发布博客

    参考园子里推荐的方式,觉得使用word发布挺好的,尝试了一下,还不错,记录下来备用   参考连接: http://www.cnblogs.com/liuxianan/archive/2013/04/1 ...

  4. 关于RTP负载类型及时间戳介绍

    转自:http://www.360doc.com/content/11/1018/13/1016783_157133781.shtml 首 先,看RTP协议包头的格式: 前12个字节在每一个RTP p ...

  5. 官方Tomcat 8.0.24 Web漏洞整改记录

    测试环境 web服务器:apache-tomcat-8.0.24-windows-x64 测试工具:Acunetix Web Vulnerability Scanner 9.5 官方Tomcat测试结 ...

  6. Struts2请求参数校验

    校验的分类 客户端数据校验 和 服务器端数据校验 客户端数据校验 ,通过JavaScript 完成校验 (改善用户体验,使用户减少出错 ) 服务器数据校验 ,通过Java代码 完成校验 struts2 ...

  7. Android 中常用的布局

    一.线性布局----LinearLayout   horizontal 水平 <?xml version="1.0" encoding="utf-8"?& ...

  8. SpringRMI解析4-客户端实现

    根据客户端配置文件,锁定入口类为RMIProxyFactoryBean,同样根据类的层次结构查找入口函数. <bean id="rmiServiceProxy" class= ...

  9. nodejs随记03

    文件操作 文件系统的操作 fs.readFile(filename, [options], callback) fs.writeFile(filename, data, [options], call ...

  10. [工作中的设计模式]策略模式stategy

    一.模式解析 策略模式定义了一系列的算法,并将每一个算法封装起来,而且使它们还可以相互替换.策略模式让算法独立于使用它的客户而独立变化. 策略模式的关键点为: 1.多种算法存在 2.算法继承同样的接口 ...