Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

When user taps cancel, I want to go back to 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

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


}
like image 929
William Falcon Avatar asked Dec 12 '22 19:12

William Falcon


1 Answers

-(void) searchBarCancelButtonClicked:(UISearchBar *)searchBar{
    [self.searchDisplayController setActive:NO animated:YES];
    self.navigationController popToViewController:UIViewControllerA animated:YES;
}
like image 78
LE SANG Avatar answered Jan 18 '23 19:01

LE SANG