UIImagePickerController throws ERROR: 185: Error c

2019-02-05 23:30发布

when i try to use UIImagePickerController to select a video from camera roll in the iOS-Simulator of XCode 5, i get the aforementioned error. this is the output:

2013-11-02 21:28:44.788 Imagepicker[89146:1403] 21:28:44.788 ERROR:     185: Error creating aggregate audio device: 'what'
2013-11-02 21:28:44.788 Imagepicker[89146:1403] 21:28:44.788 WARNING:   219: The input device is 0x32; 'AppleHDAEngineInput:1B,0,1,1:2'
2013-11-02 21:28:44.789 Imagepicker[89146:1403] 21:28:44.789 WARNING:   223: The output device is 0x28; 'AppleHDAEngineOutput:1B,0,1,2:0'
2013-11-02 21:28:44.790 Imagepicker[89146:1403] 21:28:44.790 ERROR:     398: error 'what'
2013-11-02 21:28:44.791 Imagepicker[89146:a0b] 21:28:44.791 ERROR:     398: error -66680
2013-11-02 21:28:44.791 Imagepicker[89146:a0b] 21:28:44.791 ERROR:     398: error -66680
2013-11-02 21:28:44.792 Imagepicker[89146:a0b] 21:28:44.792 ERROR:     398: error -66680
2013-11-02 21:28:44.792 Imagepicker[89146:a0b] 21:28:44.792 ERROR:     398: error -66680

my code is:

imagePicker = [[UIImagePickerController alloc] init];
imagePicker.mediaTypes =[[NSArray alloc] initWithObjects: (NSString *) kUTTypeMovie,kUTTypeVideo,kUTTypeImage, nil];
[imagePicker setSourceType:UIImagePickerControllerSourceTypePhotoLibrary];
[imagePicker setDelegate:self];
[self presentViewController:imagePicker animated:YES completion:nil];

the image picker shows up, shows a preview with cancel, play and choose button and a dialog that says "The operation could not be completed". after pressing "OK" (the only button), the preview freezes.

-(void) imagePickerController:(UIImagePickerController *)picker didFinishPickingMediaWithInfo:(NSDictionary *)info

never gets called. it all works fine with images.

4条回答
做自己的国王
2楼-- · 2019-02-06 00:17

I've had exactly the same problem with the latest toolchain, but the following fixed it for me;

  1. On the simulator Hardware menu, select TV Out->640x480.

  2. Attempt to launch your app from Xcode, it may fail with a springboard error.

  3. On the simulator Hardware menu, select TV Out->Disabled.

After that the ImagePickerController should now work as expected.

查看更多
在下西门庆
3楼-- · 2019-02-06 00:27

I faced same error when I tried to run an audio file on simulator. The strange cause I discovered was connection of my headphones to mac when simulator was running. It couldn't detect new state of audio probably, so this exception was raised. Restarting simulator solved the issue.

查看更多
走好不送
4楼-- · 2019-02-06 00:31

"iOS simulator" -> "Reset content and settigs..." solved similar problem in my case.

查看更多
何必那么认真
5楼-- · 2019-02-06 00:34

Reset Your Simulator IOS Simulator->Reset Content and Settings..

查看更多
登录 后发表回答