简体   繁体   English

当我搜索时,单元格中的按钮操作不起作用

[英]When I search , Button action in Cell don't work

In my app, I used XLPagerTabStrip ! 在我的应用程序中,我使用了XLPagerTabStrip library. 图书馆。

[ HomeViewController like this 1 [ HomeViewController像这样 1

In my HomeView controller, I have a 3 child view that uses same searchBar in NavigationController. 在我的HomeView控制器中,我有3个子视图,在NavigationController中使用相同的searchBar。

In my ChildOneController, I have a tableView that list videos. 在我的ChildOneController中,我有一个tableView列出了视频。

I have a button in TableViewCell. 我在TableViewCell中有一个按钮。 When I click this button, pushviewController. 当我单击此按钮时,为pushviewController。 But when i searched and click this button push don't work. 但是,当我搜索并单击此按钮时,按钮不起作用。

here is my code : 这是我的代码:

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)
        }
    }

any advice ? 有什么建议吗?

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

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

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM