iphone - Create search field in Tableview -
i creating application table view, has large amount of data in it. because of this, necessary me use search field.
does have idea how create search-option in tableview?
use uisearchbar property, declare using
searchbar = [[uisearchbar alloc] initwithframe:cgrectmake(0,0,320,30)];
and add uiviewcontroller's view subview.
after that, use searchbar delegate methods in view controller:
-(void)searchbartextdidbeginediting:(uisearchbar *)searchbar { -(void)searchbartextdidendediting:(uisearchbar *)searchbar { -(void)searchbar:(uisearchbar *)searchbar textdidchange:(nsstring *)searchtext { -(void)searchbarcancelbuttonclicked:(uisearchbar *)searchbar
check out this tutorial hang of search bar , delegates!
edit: method isn't using searchbar in tableview itself, above it. means have put tableview subview of uiviewcontroller, , searchbar subview of same uiviewcontroller well!
Comments
Post a Comment