ios5 “The operation could not be conpleted” when UIImagePickerController pick a 3gp file, and the whole UI freezed?

[亡魂溺海] 提交于 2019-12-06 06:31:51

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!