Summary of search for a vegetarian
1, plus is the Searchdisplaycontroller
2, two agent uisearchbardelegate,uisearchdisplaydelegate and set
3, Wired Searchdisplay and Searchbar
4, the Self.tableview.tableheaderview=self.searchbar fixed to live
5. Methods to invoke when searching
#pragma mark Search Method-(BOOL) Searchdisplaycontroller: (Uisearchdisplaycontroller *) controller Shouldreloadtableforsearchstring: (NSString *) searchstring{nspredicate * query=[nspredicate predicateWithFormat:@ " Self.name contains[c]%@ ", searchstring]; Self.searchresult=[self.contacts Filteredarrayusingpredicate:query]; return YES;}
6, the search will show their own tableview determine is not Searchdisplay.searchresultstableview
7. Modify TableView Count
8, jump to judge to see the contact
Reference http://www.cnblogs.com/lesliefang/p/3929677.html
iOS Basic Development Search Function Summary