线程8:信号SIGABRT执行segue时

时间:2017-07-23 05:59:41

标签: ios swift xcode

当我保存视频时会发生这种情况,我也试图转向另一个视图控制器。我不确定应用程序崩溃的原因

func finalExportCompletion(_ session: AVAssetExportSession) {
    PhotoManager().saveVideoToUserLibrary(fileUrl: session.outputURL!) { (success, error) in
        if success {
            ProgressHUD.showSuccess("Video Saved", interaction: true)
            self.finalVideo = session.outputURL!
            //FileManager.default.clearTmpDirectory()
            self.clipsCollectionView.reloadData()
        } else {
            ProgressHUD.show(error?.localizedDescription)
        }
        self.performSegue(withIdentifier: "toPostVideoViewController", sender: nil)
    }
}

1 个答案:

答案 0 :(得分:0)

当您处于后台线程时,您的崩溃将发布在UI中的修改,正如您的崩溃日志所述,@ marddy在他的评论中,THREAD 8是后台线程,您需要在{中执行所有UI操作{1}}这是“主线程”你必须像这样修改你的代码

Thread 1