-(Void) searchBarSearchButtonClicked: (UISearchBar *) activeSearchBar {
NSString * query = [searchBar.text stringByReplacingOccurrencesOfString: @ "" withString: @ "+"];
NSURL * url = [NSURL URLWithString: [NSString stringWithFormat: @ "http://www.google.com/search?q =%@", query]];
NSURLRequest * requestObj = [NSURLRequest requestWithURL: url];
[Home loadRequest: requestObj];
}
-(Void) loadView {
[Super loadView];
CGRect bounds = [[UIScreen mainScreen] applicationFrame];
searchBar = [[UISearchBar alloc] initWithFrame: CGRectMake (0.0, 0.0, bounds.size.width, 48.0)];
searchBar.delegate = self;
[Self.view addSubview: searchBar];
}
我不会说英语,依赖翻译。 由于语言问题,这可能是键盘问题,还是编码问题?
出现错误原因。 如果用韩文书写,则会发生错误。 但如果用英文写作,则不会发生错误。