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
If you are using your UISearchBar with an UISearchDisplayController, you can simply set the cancel button to show, in the "searchDisplayControllerWillBeginSearch" delegate method, like so: (iOS 7 tested)
-(void)searchDisplayControllerWillBeginSearch:(UISearchDisplayController *)controller{
controller.searchBar.showsCancelButton = YES;
}