I have an xCode project that contains a tableview with a “Search Bar and Search Display Controller” to allow the user to refine the list of displayed items. In general, the
In my case, I had repositioned the searchbar to the top of the screen, and there was an invisible view which is overlapped over the searchbar.
Thus cancel button was not touched actually.
So, I have brought the seachbar front when [searchBarTextDidBeginEditing] method was called like below.
-(void)searchBarTextDidBeginEditing:(UISearchBar *)searchBar{
lc_SearchBarYPos.constant = 20.0f; //this is code to reposition the searchbar
[self.view bringSubviewToFront:searchBar];
}
Hope this may help.