开发者

iPhone Filling UITableView with JSON results (using search entered in UISearchBar)

Does anyone have a link to a tutorial for using a UISearchBar as the entry for a search, and a UITableView to display results returned in JSON?

Thank you!

Please no suggestions to RTFM - I can't find anything about using a UISearchBar for 开发者_如何学Goa remote search.


Implement the UISearchBarDelegate methods in your class. Then you can hit the web service in this delegate method

- (void)searchBarTextDidEndEditing:(UISearchBar *)searchBar
{
//Hit the webservice from here using searchBar.text

}

or if u need a dynamic search you can use the following method.

- (void)searchBar:(UISearchBar *)theSearchBar textDidChange:(NSString *)searchText {

}

After getting the data from the server update the datasource of your tableView and call the (You can use SBJSON parser to parse your JSON response)

[self.tableView reloadData];
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜