我正在开发一个可以拍照并将其保存到设备的应用程序。单击“保存”时,它似乎花费了太长时间,并在日志中抛出此消息:
wait_fences: failed to receive reply: 10004003
这是保存拍摄的图片时调用的方法:
- (void)imagePickerController:(UIImagePickerController *)picker didFinishPickingMediaWithInfo:(NSDictionary *)info {
[picker dismissModalViewControllerAnimated:YES];
AppDelegate *appDelegate = (AppDelegate *)[[UIApplication sharedApplication] delegate];
UIImage *image = [info objectForKey:UIImagePickerControllerOriginalImage];
int img_count = [[appDelegate retrieveFromUserDefaults:@"image_saved"] intValue];
img_count = img_count + 1;
NSString *imageName = [[NSString alloc] initWithFormat:@"dmg_image_%@_%d", [appDelegate retrieveFromUserDefaults:@"current_job_id"], img_count];
[appDelegate saveImage:image withName:imageName];
[appDelegate saveToUserDefaults:imageName key:@"inspection_image"];
[damageImage setImage:image];
[damageDesc becomeFirstResponder];
}
我确定我遗漏了一些简单的东西,而且我认为抛出此消息的任何原因都是它运行缓慢的原因。
我读过其他人有这个问题,但他们正在使用警报呼叫,而不是拍照返回。在调用 didFinishPicking 时我是否应该稍微延迟一下?
谢谢!