【问题标题】:When I search , Button action in Cell don't work当我搜索时,单元格中的按钮操作不起作用
【发布时间】:2018-02-17 20:16:33
【问题描述】:

在我的应用程序中,我使用了XLPagerTabStrip!图书馆。

[HomeViewController like this 1

在我的 HomeView 控制器中,我有一个在 NavigationController 中使用相同 searchBar 的 3 个子视图。

在我的 ChildOneController 中,我有一个列出视频的 tableView。

我在 TableViewCell 中有一个按钮。当我单击此按钮时,pushviewController。但是当我搜索并单击此按钮时,推送不起作用。

这是我的代码:

func joinBtnDelegate(at index: IndexPath) {

        if let jlist = self.joinAllAllowedInnoList , !jlist.isEmpty{
            Dataholder.sharedInstance().selectedJoin = jlist[index.row]
            let vc = self.storyboard?.instantiateViewController(withIdentifier: "PickVideoViewController") as! PickVideoViewController
           self.navigationController?.pushViewController(vc, animated: true)
        }
    }

有什么建议吗?

【问题讨论】:

    标签: swift uinavigationcontroller swift4


    【解决方案1】:

    确保navigationController 在下面的代码行中不应为nil

    self.navigationController?.pushViewController(vc, animated: true)
    

    【讨论】:

      猜你喜欢
      • 2019-09-02
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2022-11-04
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多