我的导航控制器在返回标题时出现了什么问题?

时间:2016-01-15 12:48:31

标签: ios uinavigationcontroller viewdidappear

为什么当我从主视图控制器转到详细视图控制器并再次返回主标题时,我的故事板是否有问题? enter image description here

我已经尝试过使用viewDidAppear和viewWillAppear

 override func viewWillAppear(animated: Bool) {
        self.title = "Title main"
        super.viewWillAppear(animated)

        if (captureSession?.running == false) {
            captureSession.startRunning();
        }
       }
    override func viewDidAppear(animated: Bool) {
        super.viewDidAppear(animated)
       self.title = "Main Title"

        do {
            let request =  NSFetchRequest(entityName: "ScannedVisitor")

            scannedVisitors = try moContext.executeFetchRequest(request) as! [ScannedVisitor]

            self.tableView.reloadData()

        } catch let error as NSError  {
            print(error)
        }

    }

用户brl214指出我可能已将导航栏拖到视图控制器上,但我无法在故事板中找到它来删除它。

有任何提示,建议吗?

[编辑]屏幕截图标签和视图

enter image description here

1 个答案:

答案 0 :(得分:0)

在父视图控制器中:

override func viewWillAppear(animated: Bool) {
self.title = "Title Main"
}