我正在寫一個應用程序,它是從圖書館或相機拍攝圖像,並使用它做一些事情。我設法加載圖片:UIImagePicker到新視圖
UIImagePickerController *picker =[[UIImagePickerController alloc] init];
picker.delegate = self;
if ([@"cam" isEqual:[[sender titleLabel] text]]) {
picker.sourceType = UIImagePickerControllerSourceTypeCamera;
} else if ([@"album" isEqual:[[sender titleLabel] text]]) {
picker.sourceType = UIImagePickerControllerSourceTypePhotoLibrary;
}
[self presentModalViewController:picker animated:YES];
工作正常。但我想要做的是當一張照片被選中時,我想要去一個新的視角。 我有方法changeView
去指定的視圖,但是當我從 -(void)imagePickerController:(UIImagePickerController *)picker didFinishPickingMediaWithInfo:(NSDictionary *)info
它叫它由於某種原因不起作用。
程序進入segue
類,但沒有任何反應。
屬性添加的NSLog(@ 「圖像拾取被駁回!」); (void)imagePickerController:(UIImagePickerController *)picker didFinishPickingMediaWithInfo:(NSDictionary *)info方法來查看它是否被調用。如果是這樣,這是你改變你的觀點的方式的問題。如果沒有被調用,這是別的東西(可能是您的圖像選擇器的問題)。 – gtmtg
對不起,代碼被格式化爲純文本 - 它不讓我格式化代碼出於某種原因... – gtmtg
我可以看到您的imagePickerController方法嗎? – mkral