首先我保存一个视频
// 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。...当我导航到它时。...我将所有这些类隔离为独立视图,因此我知道工作流程可以正常工作。我究竟做错了什么?谢谢
答案 0 :(得分:0)
我认为您缺少在类theString
中声明变量WordViewController