我正在使用 xcode 4.5.2 并且我想在UIImagePickerController
基于导航栏的应用程序上使用它,除非用户选择图像后图像保持空白,否则一切正常。
用户应该点击按钮->选择相机或从 ActionSheet 中存在->选择图像,然后..什么都没有显示!
我已经添加了代表<UINavigationControllerDelegate,UIActionSheetDelegate, UIImagePickerControllerDelegate>
并正确链接了 IB 中的所有内容.. 我对此非常确定,除非我不确定这种方法:
- (void) imagePickerController:(UIImagePickerController *)thePicker didFinishPickingMediaWithInfo:(NSDictionary *)imageInfo{
[[imgPicker parentViewController] dismissViewControllerAnimated:YES completion:nil];
UIImage *img = [imageInfo objectForKey:@"UIImagePickerControllerEditedImage"];
currentImg.image = nil;
self.currentImg.image = img;
}
我也用过这个:
- (void)imagePickerController:(UIImagePickerController *)picker didFinishPickingImage:(UIImage *)img editingInfo:(NSDictionary *)editInfo {
image.image = img;
[[picker parentViewController] dismissModalViewControllerAnimated:YES];
}
什么也没发生..