首先,我保存视频

 // MARK: - UIImagePickerControllerDelegate

    extension RecVidController: UIImagePickerControllerDelegate {
        func imagePickerController(_ picker: UIImagePickerController,
                                   didFinishPickingMediaWithInfo info: [UIImagePickerController.InfoKey : Any]) {

    UISaveVideoAtPathToSavedPhotosAlbum(url.path, self, #selector(video(_:didFinishSavingWithError:contextInfo:)), nil)


保存完成后,它就来到了这里。...在这一点上,我想导航到另一个控制器...

    @objc func video(_ videoPath: String, didFinishSavingWithError error: Error?, contextInfo info: AnyObject) {

            let dwc = WordViewController(nibName:"WordViewController",bundle:nil)
            dwc.theString = "test"
            navigationController!.pushViewController(dwc, animated: true)


}


然而...

class WordViewController: UIViewController {

@IBOutlet weak var txtWordDef: UITextField!
var theString:String!


我所有的接口变量(例如txtWordDef)都为nil。...当我导航到它时。...我将所有这些类隔离为独立视图,因此我知道工作流程可以正常工作。我究竟做错了什么?谢谢

最佳答案

我认为您没有在类theString中声明变量WordViewController

关于ios - 保存视频后无法导航到另一个 Controller ,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/52547528/

10-13 09:26