iOS 搜索框search bar开始搜索

- (void)searchBarSearchButtonClicked:(UISearchBar *)searchBar {
// things to be done regarding the text
NSSting *text = seachBar.text;
}

记得在viewDidLoad设置:

searchBar.delegate =self;

参考:

http://jduff.github.io/2010/03/01/building-a-searchview-with-uisearchbar-and-uitableview/

http://stackoverflow.com/questions/6516643/searchbar-not-working-when-search-button-is-clicked

你可能感兴趣的:(iOS)