快速浏览UIVIewControllers时无法保留选定的行

问题描述

我有两个用于过滤目的的uiviewcontrollers,从使用按钮的第一个控制器可以显示第二个视图控制器,从第二个视图控制器有一个表格视图,然后选择它们的行并将这些行值传递给第一个视图控制器。它传递的值很好,但是我再次单击第一个控制器的相同按钮,就像之前的明智之举一样,它打开了第二个控制器,但我已经选择的行似乎未被选中。

示例代码:用于单击“第一个控制器”按钮以打开视图控制器

    @objc func empFilterButton(_ sender: Any){
        let controller = EmployeeFilterViewController()
        self.navigationController?.pushViewController(controller,animated: true)

    }

示例代码:用于选择行并将这些值传递给第一视图控制器

@objc func applyFilter(_ sender: Any){
    let empViewCtrl = EmployeeViewController()
    empViewCtrl.deptIdString = deptIdString
    empViewCtrl.dateIdString = dateIdString
    empViewCtrl.shiftIdString = shiftIdString
    empViewCtrl.locationIdString = locationIdString
    self.navigationController?.pushViewController(empViewCtrl,animated: true)
}

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)