1
當我嘗試從xcode 4.5調用相冊時,應用程序崩潰。 注意:我將應用程序方向設置爲橫向模式。在你的邏輯崩潰在self.view presentviewcontroller:UIImagePickerController在iOS 6
UIImagePickerController *picker=nil;
if ([UIImagePickerController isSourceTypeAvailable:UIImagePickerControllerSourceTypeSavedPhotosAlbum])
{
picker = [[UIImagePickerController alloc] init];
picker.delegate = self;
picker.sourceType = UIImagePickerControllerSourceTypePhotoLibrary;
picker.allowsEditing = NO;
picker.mediaTypes = [UIImagePickerController availableMediaTypesForSourceType:
UIImagePickerControllerSourceTypeSavedPhotosAlbum];
}
if ([[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPhone) {
[self presentViewController:picker animated:YES completion:nil];
}
該代碼位於視圖控制器中? –
什麼是異常/錯誤/崩潰的樣子? –
你能更具體嗎?當第二個陳述達成時,你如何確信第一個陳述是真實的?當你打電話給presentViewController :::你怎麼能確定picker不是零? –