奇怪的错误:wait_fences:未能收到回复:10004003

Adr*_*rli 8 iphone uiimagepickercontroller ios

我知道还有其他问题可以解决这个错误,但这些答案对我没有任何帮助.我想知道是否有人知道确切原因,如果没有人知道,这里是代码:

-(void) imagePickerController : (UIImagePickerController *) picker
        didFinishPickingImage : (UIImage *) image
                  editingInfo : (NSDictionary *) editingInfo {

    self.imageView.image = image;
    [picker dismissModalViewControllerAnimated:YES];
    [picker release];
    //[self myNextResponder];
}
Run Code Online (Sandbox Code Playgroud)

此错误:wait_fences:未能收到回复:10004003,此方法退出后立即显示.我用谷歌搜索过,无法弄明白.

dug*_*oon 4

看来您使用了选取器对象作为present/dismissModalViewController 的调用者。该文档建议使用“父”视图控制器。

对于“父级”,我使用 self.navigationController (因为它不会去任何地方)

我的选择器委托的取消方法的实现如下所示......

- (void)imagePickerControllerDidCancel:(UIImagePickerController *)picker
{
    // make sure the picker doesn't try to access the soon to die delegate
    picker.delegate = nil;

    [self.navigationController dismissModalViewControllerAnimated:YES];
    [self.navigationController popViewControllerAnimated:YES];
}
Run Code Online (Sandbox Code Playgroud)