关闭

LGPhotoBrowser 网络请求图片 报出This application is modifying the autolayout engine from a background thread

标签: javascriptios9LGPhotoBroThis-appli
626人阅读 评论(0) 收藏 举报
分类:

由于自己水平有限 在项目中集成了一个大牛写的仿微信的拍照 相册 图片游览器 集合的开源api LGPhotoBrowser 那么问题就来了 可能是没有更新到最新api吧 后面有时间再去仔细研究

切入正题
项目中需要做 点击web 界面上的图片是 可以实现放大多张查看的功能 其实就是要做一个url的图片游览器

集成很简单
这里写图片描述

但是 在获取网络图片的时候 报出了这个
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.

这里写图片描述

当时一脸的懵呆 于是 查找代码啊 谷歌大婶啊 那么问题就来了

ios9里触发js方法使用时,遇到了这个问题,代码如下:

self.context[@"sendMoney"] = ^(NSString *str){  
        NSLog(@"--sendMoney----%@",str);  
         [weakSelf pushViewController:@"TradeViewController" withArgment:nil];  
    };

找了下资料说写在GCD里就没问题,修改如下:

self.context[@"sendMoney"] = ^(NSString *str){  
        NSLog(@"--sendMoney----%@",str);  
        dispatch_async(dispatch_get_main_queue(), ^{  
            [weakSelf pushViewController:@"TradeViewController" withArgment:nil];  
        });  
    }; 

这样就没问题了,看来ios9里坑不少。

网址链接
http://blog.csdn.net/quanqinyang/article/details/49516593

以上是另一位大牛写的 自己也遇到过这样的问题 贴上差异代码
1 原生态的
这里写图片描述

2 改后的
这里写图片描述

于是 问题就决绝了 哈哈哈哈哈哈 还是楼上大神那句话 看来ios9里坑不少啊。

0
0
查看评论

iOS9 This application is modifying the autolayout engine from a background thread, which

以前在Xcode7之间项目没有问题,但是使用Xcode7后 突然不好使了,This application is modifying the autolayout engine from a background thread, which can lead to engi.... 查了查资料 把...
  • Amencome
  • Amencome
  • 2015-10-14 11:22
  • 10208

芒果iOS开发之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 engine corruption and weird crashes. This will cause ...
  • CrazyZhang1990
  • CrazyZhang1990
  • 2016-09-02 10:44
  • 2156

线程:This application is modifying the autolayout engin from a background thread

昨天处理相册问题是,遇到这样的问题: This application is modifying the autolayout engin from a background thread,which can lead to engine corruption and weird crashes,...
  • fuzongjian
  • fuzongjian
  • 2016-02-02 08:42
  • 7728

巧妙解决 this application is modifying the autolayout engine from a background 问题

有时候我们会遇到这样的错误而导致 app 崩溃:This application is modifying the autolayout engine from a background thread, which can lead to engine corruption and weird cr...
  • kmyhy
  • kmyhy
  • 2016-08-01 11:01
  • 1573

iOS - 解决This application is modifying the autolayout engine from a background thread

This application is modifying the autolayout engine from a background thread after the engine was accessed from the main thread. This can lead to engi...
  • lincsdnnet
  • lincsdnnet
  • 2016-12-15 16:29
  • 830

崩溃问题:iOS9 This application is modifying the autolayout engine from a background thread, which

总结:通知、更新UI尽量放到主线程中之行,以防无法无法预见到问题出现 以前在Xcode7之间项目没有问题,但是使用Xcode7后 突然不好使了,This application is modifying the autolayout engine from a background threa...
  • jijiji000111
  • jijiji000111
  • 2015-12-19 17:07
  • 4560

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 engine corruption and weird crashes. This will ca...
  • ws1352864983
  • ws1352864983
  • 2016-08-03 18:22
  • 234

This application is modifying the autolayout engine from a background thread after 。。。

解决办法:dispatch_async(dispatch_get_main_queue(), ^{                      // 更UI  });
  • yuhao309
  • yuhao309
  • 2016-11-22 14:10
  • 306

This application is modifying the autolayout engine from a background thread

我在用NSURLSession做请求: NSURL *url = [NSURL URLWithString:[NSString stringWithFormat:@"http://XXX"]]; NSURLRequ...
  • u013025098
  • u013025098
  • 2016-06-30 14:26
  • 335

iOS9 This application is modifying the autolayout engine from a background thread, which

以前在Xcode7之间项目没有问题,但是使用Xcode7后 突然不好使了,This application is modifying the autolayout engine from a background thread, which can lead to engi.... 查了查资料...
  • agonie201218
  • agonie201218
  • 2015-11-19 10:46
  • 450
    个人资料
    • 访问:113397次
    • 积分:3289
    • 等级:
    • 排名:第12217名
    • 原创:212篇
    • 转载:77篇
    • 译文:0篇
    • 评论:27条