简体   繁体   English

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

[英]search bar cancel button push to initial view controller

I have been searching and haven't been able to make it work. 我一直在寻找并且无法使其发挥作用。

TableviewcontrollerA segues a TableviewcontrollerB with searchbar as firstresponder TableviewcontrollerA searchbar将TableviewcontrollerB作为firstresponder

When user taps cancel, I want to go back to TableviewcontrollerA 当用户点击取消时,我想回到TableviewcontrollerA

I have tried quite a few things in the below method with no luck. 我在下面的方法中尝试了很多东西而没有运气。 What am I missing? 我错过了什么?

Thanks BTW - The segue is done on IB, not code 谢谢BTW - segue是在IB上完成的,而不是代码

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


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

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

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