2012-03-21 116 views

回答

1
//Add and bind Searchbar Controller to your viewcontroller 

- (void) viewDidLoad 
{ 
    //Don't forget to add <UISearchBarDelegate> into your .h file 
    yourSearchbar.delegate=self; 
} 

//implement search bar delegate 
- (void)searchBarSearchButtonClicked:(UISearchBar *)searchBar 
{ 
    NSLog(@"%@",searchBar.text); 

    //next you've to setup logic to pass search text to your mapview 
} 
+0

和搜索显示怎么样? 你可以用界面生成器来做到这一点吗? – 2012-03-21 12:45:51

+0

[检查出来](http://stackoverflow.com/questions/6520223/search-bar-display-controller) – Hemang 2012-03-21 12:55:31

+0

我已经看到它。我的问题是 - 我无法在搜索显示控制器上找到任何文档。另外,我非常好奇,为什么我无法将界面生成器中的搜索栏添加到地图视图中,而我可以将其添加到表视图中。 – 2012-03-22 11:08:03

相关问题