How do I use UISearchBar to search the web?
I want to use 开发者_如何转开发the UISearchBar and used its text which further can be put into a url and that url will search the web. I am unable to dismiss the keyboard. I have tried using the first responder thng but that doesn't seems to work. I am new to iPhone development and fairly new to programming world so please bear with me. any help would be appritiated.
Add a search bar delegate to yourclass.h
as following:
@interface yourclass : yourviewcontroller < UISearchBarDelegate >
Then, implement this function of the delegate into yourclass.m
:
(void)searchBarSearchButtonClicked:(UISearchBar *)searchBar
{
[searchBar resignFirstResponder];
//your code
}
精彩评论