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