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

释放双眼,带上耳机,听听看~!

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里坑不少。

人已赞赏
iOS文章

iOS在控制器间跳转实现过渡动画

2020-5-16 15:48:02

iOS文章

IOS Number处理(int-->NSNumber,NSNumber-->nsinteger,string -->double,CGFloat --> dobule)

2020-5-16 17:03:03

0 条回复 A文章作者 M管理员
    暂无讨论,说说你的看法吧
个人中心
购物车
优惠劵
今日签到
有新私信 私信列表
搜索