为什么当我从主视图控制器转到详细视图控制器并再次返回主标题时,我的故事板是否有问题?
我已经尝试过使用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指出我可能已将导航栏拖到视图控制器上,但我无法在故事板中找到它来删除它。
有任何提示,建议吗?
[编辑]屏幕截图标签和视图
答案 0 :(得分:0)
在父视图控制器中:
override func viewWillAppear(animated: Bool) {
self.title = "Title Main"
}