imagePickerController:didFinishPickingMediaWithInfo 问题
如果我不编辑图片,结果会怎样?
(image = nil ? or image = OriginalImage)
picker.allowsImageEditing = YES;
- (void)imagePickerController:(UIImagePickerController *)picker
didFinishPickingMediaWithInfo:(NSDictionary *)info
{
UIImage *image = [info objectForKey:UIImagePickerControllerEditedImage];
}
What is the result if I didn't edit the picture?
(image = nil ? or image = OriginalImage)
picker.allowsImageEditing = YES;
- (void)imagePickerController:(UIImagePickerController *)picker
didFinishPickingMediaWithInfo:(NSDictionary *)info
{
UIImage *image = [info objectForKey:UIImagePickerControllerEditedImage];
}
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
该键要么不存在于字典中,要么与原始图像相同。最简单的方法就是进行防御性编码:
这样,即使不同版本的 iOS 上的行为有所不同,您仍然可以获得合理的结果。
Either the key would not exist in the dictionary or it would be the same as the original image. The easiest thing to do is just to code defensively:
That way you'll still get sane results even if the behavior is different on different versions of iOS.