Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我想在点击书签按钮时显示搜索历史记录:包含最后 10 个搜索条目的表格将在搜索栏下方弹出。(如谷歌自动完成)
我有搜索条目的搜索NSMutableArray历史NSString。
NSMutableArray
NSString
我应该如何动态调用该列表?
只需执行
- (BOOL)searchBarShouldBeginEditing:(UISearchBar *)searchBar
UISearchBar在您的文件中委托。在此方法中,添加代码以显示包含UITableView历史列表的弹出视图。
UISearchBar
UITableView
确保你已经写searchBar.delegate = self在你的.m文件中。
searchBar.delegate = self
.m