I have an xCode project that contains a tabular view with a “search bar and search display” so that the user can refine the list of displayed items. In general, the guidelines given at http://www.raywenderlich.com/16873/how-to-add-search-into-a-table-view have been followed. I recently downloaded the latest version of xCode (version 5.0 (5A1413)) with iOS 7 support and tested the corresponding application for different purposes.
When you run this application on an iOS 6 target (emulator or real device), it works as expected that pressing the cancel button removes the search bar, and pressing the clear button (a little gray x) clears all the search criteria already entered by the user. But when the project starts on iOS 7, the clear and cancel button do not work.
The searchBarCancelButtonClicked method is implemented in this project, and I confirmed that it is not called when the target application is running iOS 7.
- (void)searchBarCancelButtonClicked:(UISearchBar *)SearchBar { NSLog(@"searchBarCancelButtonClicked called"); self.searchBar.text = nil; …
My table view controller is configured as UISearchDisplayDelegate and UISearchBarDelegate. And it looks like this still works as searchBar: textDidChange: is called for either iOS 6 or 7 goals.
@interface ItemViewController () <UISearchDisplayDelegate, UISearchBarDelegate> … @end
I do not see other posts related to this or any material for changing iOS 7 (e.g. https://developer.apple.com/library/ios/documentation/UserExperience/Conceptual/TransitionGuide/Bars.html#//apple_ref/doc / uid / TP40013174-CH8-SW1 ), which mentions any transcoding that must be done to support iOS7.
Any thoughts on this? Thanks
ios objective-c ios7 uisearchbar
Mike
source share