swift - 当我搜索时,Cell 中的按钮操作不起作用

标签 swift uinavigationcontroller swift4

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

[ HomeViewController like this 1

在我的 HomeView Controller 中,我有一个在 NavigationController 中使用相同 searchBar 的 3 个 subview 。

在我的 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)
        }
    }

有什么建议吗?

最佳答案

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

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

关于swift - 当我搜索时,Cell 中的按钮操作不起作用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/48845538/

相关文章:

ios - 表格 View 自定义单元格中的按钮

ios - 多选 TableView - 当部分展开/折叠时在自定义标题中旋转图像

iphone - 如何删除默认导航栏按钮

iOS:默认后退按钮显示在自定义左侧导航按钮上

date - 如何在 Swift 中解析/创建格式为小数秒 UTC 时区(ISO 8601、RFC 3339)的日期时间戳?

ios - 如何在处理 catchError 后恢复数据源

ios - 选项卡栏 Controller 中两个选项卡项的相同 View

Swift 4 隐藏按钮不再出现

swift - 禁止在 Swift 中设置特定值

swift - NSCollectionView,Swift 4 - 无法调用 "register"