无法将类型的值转换为 UINavigationController swift3

Could not cast value of type to UINavigationController swift3

我收到以下转换错误(当我单击模拟器 [NavigationController] 中的“+”按钮时)并且无法弄清楚原因。 我正在使用 Swift3。感谢您的帮助!

MainVC.swift

        protocol AddTaskDelegate: class {
            func saveTask(by controller: AddVC, with data: [String:String])
        }


        class MainVC: UIViewController {
            //    all tasks from the database
            var tasks = [ToDoListTasks]()

            @IBOutlet weak var table: UITableView!

            //    connect with Core Data
            let managedObjectContext = (UIApplication.shared.delegate as! AppDelegate).persistentContainer.viewContext
    ...

//    prepare segue to send data
    override func prepare(for segue: UIStoryboardSegue, sender: Any?) {
        if segue.identifier == "AddSegue" {
            let navigationController = segue.destination as! UINavigationController
            let childViewController = navigationController.topViewController as! AddVC

            childViewController.delegate = self as! AddTaskDelegate
        }
    }
 }

AddVC.swift

class AddVC: UIViewController {

    weak var delegate: AddTaskDelegate?
...

请阅读错误信息。你是说

segue.destination as! UINavigationController

但是这个 segue 的目的地是不是 UINavigationController。