呈现/显示ViewController的对象等于nil

时间:2016-12-14 12:27:12

标签: ios swift swift3 presentviewcontroller

此func用于显示/呈现ViewController。

let noteViewController = NoteViewController()

extension NoteTableViewController: UIViewControllerTransitioningDelegate {
func remindLater() {
    if let note = notificationNote?.copy() as? Note {
        noteViewController.transitioningDelegate = self
        noteViewController.modalPresentationStyle = UIModalPresentationStyle.fullScreen
        noteViewController.modalTransitionStyle = UIModalTransitionStyle.coverVertical
        resultSearchController.searchBar.isHidden = true
        present(noteViewController, animated: true, completion: nil)
        //show(noteViewController, sender: self)
    }
}
}

在ViewController上,我试图呈现UIDatePicker对象的插座。在viewdidLoad()方法上,我有这一行导致错误。

frameDatePicker = remindDatePicker.frame

所以,我发现remindDatePicker和其他对象等于nil。 我应该在哪里找到错误?

0 个答案:

没有答案