搞不懂这段代码为啥 8.1会崩溃 9.1不会崩
UIAlertController *alertVC = [UIAlertControlleralertControllerWithTitle:str message:messageStrpreferredStyle:UIAlertControllerStyleAlert];
[selfpresentViewController:alertVC animated:YEScompletion:^{
[NSThreadsleepForTimeInterval:1];
[_session startRunning];
[alertVC dismissViewControllerAnimated:YEScompletion:nil];
}];
//改成下面这段就没问题了
UIAlertController *alertC = [UIAlertControlleralertControllerWithTitle:str message:messageStrpreferredStyle:UIAlertControllerStyleAlert];
[selfpresentViewController:alertC animated:YEScompletion:^{
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(1.0 * NSEC_PER_SEC)),dispatch_get_main_queue(), ^{
[_session startRunning];
[alertC dismissViewControllerAnimated:YEScompletion:nil];
});
}];