搜索栏取消按钮按下初始视图控制器

Wil*_*con 4 uisearchbar uisearchbardisplaycontrol ios segue

我一直在寻找并且无法使其发挥作用.

TableviewcontrollerA用搜索栏将a表示TableviewcontrollerBfirstresponder

当用户点击取消时,我想回去 TableviewcontrollerA

我在下面的方法中尝试了很多东西而没有运气.我错过了什么?

谢谢BTW - segue是在IB上完成的,而不是代码

-(void) searchBarCancelButtonClicked:(UISearchBar *)searchBar{


}
Run Code Online (Sandbox Code Playgroud)

LE *_*ANG 13

-(void) searchBarCancelButtonClicked:(UISearchBar *)searchBar{
    [self.searchDisplayController setActive:NO animated:YES];
    self.navigationController popToViewController:UIViewControllerA animated:YES;
}
Run Code Online (Sandbox Code Playgroud)