簡體   English   中英

當我搜索時,單元格中的按鈕操作不起作用

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

在我的應用程序中,我使用了XLPagerTabStrip 圖書館。

[ HomeViewController像這樣 1

在我的HomeView控制器中,我有3個子視圖,在NavigationController中使用相同的searchBar。

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

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM