问题
Normal video file “choose” and "compressing videos", enter the imagePickerController:didFinishPickingMediaWithInof callback.
But from "camera roll" pick one 3gp file, occur “The operation could not be completed”, and freezing, don't response to any input action. In the end, I am forced to close my app.
回答1:
This is due to selection of bad video. I got RID with the help of below code.
-(void)navigationController:(UINavigationController *)navigationController willShowViewController:(nonnull UIViewController *)viewController animated:(BOOL)animated{
if ([NSStringFromClass(viewController.class) isEqualToString:@"PUUIImageViewController"] == true){
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(0.5 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
if ([[UIApplication sharedApplication].keyWindow isMemberOfClass:[UIWindow class]]){
}else{
//There is a bad video
[navigationController popViewControllerAnimated:true];
}
});
}
}
来源:https://stackoverflow.com/questions/8075650/ios5-the-operation-could-not-be-conpleted-when-uiimagepickercontroller-pick-a