iOS 混合网页开发 xcode7 线程问题

xcode6是没有问题的

在利用JavaScriptCore与H5交互时出现异常提示:

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.

 

 

解决办法是:交互的跳转要在主线程进行

 

 dispatch_async(dispatch_get_main_queue(), ^{
                    //UI修改
                    NSLog(@"Current Thread:%@",[NSThread currentThread]);
                    [weakSelf.navigationController pushViewController:vc animated:YES];
                });
posted @ 2015-10-20 18:53  zz1230  阅读(269)  评论(0)    收藏  举报