我使用的是xcode 4.5.2,我想在我的基於導航欄的應用程序上使用UIImagePickerController
,除非在用戶選擇圖像後圖像保持空白,否則一切都可以正常工作。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];
}
並沒有發生任何事..