Nic*_*ant 17 xcode objective-c uiviewcontroller ios
解雇视图控制器时出错,之前没有看到类似的东西,互联网上没有太多关于它的信息.
继承人错误: *断言失败 - [UIKeyboardTaskQueue waitUntilAllTasksAreFinished],/ SourceCache/UIKit/UIKit-2903.2/Keyey/UIKeyboardTaskQueue.m:368
一点背景,我保存了一些数据后解除了视图控制器.数据每次都成功保存.另外,我最近更改了日期保存代码,以便在这个方法的主线程上运行,因为我在后台保存了一些问题.
任何想法为什么会这样?
提前致谢.
Sim*_*een 46
当我调用-presentViewController:animated:completion:
一个不是主线程的线程(来自网络请求中的回调)时,我收到了这个错误.解决方案是将您的调用发送到主线程的present和dismiss视图控制器:
dispatch_async(dispatch_get_main_queue(), ^{
//Code that presents or dismisses a view controller here
});
Run Code Online (Sandbox Code Playgroud)
调用摄像机视图时遇到了同样的问题
针对同一问题的Swift语法:
dispatch_async(dispatch_get_main_queue(), {
//Code that presents or dismisses a view controller here
self.presentViewController(imagePicker, animated: true, completion: nil)
})
Run Code Online (Sandbox Code Playgroud)
归档时间: |
|
查看次数: |
10113 次 |
最近记录: |