In an app that\'s supposed to run on iOS 6 and iOS 7, the cancel button of the search bar embedded in the navigation bar is not shown anymore if the app is run on iOS 7. On iOS
There does seem to be a change between iOS6 and iOS7 in that changes to the UI from xxxDidYYY
methods sometimes don't work, and you have to do it in the xxxWillYYY
method or in some code executed from the main event loop (e.g. in a block or after a short delay).
In your case, try this:
- (BOOL)searchBarShouldBeginEditing:(UISearchBar *)searchBar
{
searchBar.showsCancelButton = YES;
return YES;
}