我是iOS編程的新手,因此我提前致歉。我知道這個話題已被多次報道(我搜索了),但我似乎無法解決我的問題,這就是我發佈的原因。iOS應用程序 - 試圖從圖庫中獲取iOS照片但出現錯誤
我試圖訪問iOS的照片庫,但我不斷收到兩個錯誤:
一個是 「應用程序試圖把目標一零模態視圖控制器。」
編輯:上述錯誤是通過在ChooseExsisting中啓動_picker來解決的,正如評論中所建議的那樣。
其他
[CameraController ChooseExsiting:]:無法識別的選擇發送到實例0x157e11330'
我的代碼如下:
- (IBAction)ChooseExsiting {
UIImagePickerController *pickerController = [[UIImagePickerController alloc]
init];
pickerController.delegate = self;
[self.picker setSourceType:UIImagePickerControllerSourceTypePhotoLibrary];
[self presentViewController:_picker animated:YES completion:NULL]; }
我想象我ChooseExsisting代碼不正確。會有人有任何建議嗎?我將不勝感激。
請告訴你你在iOS模擬器或設備上運行。 –
你的模擬器中沒有照片...照片庫,所以它給這個錯誤..根據我的意見。 –
在我的設備上運行,其中有許多照片。 在更改第一個回覆建議更改的內容後(init選擇器),我收到此錯誤: – calrol2009