UISearchBar、UISearchDisplayController搜索
来源:互联网 发布:贪心算法最小生成树 编辑:程序博客网 时间:2024/05/05 04:11
UISearchBar * search=[[UISearchBaralloc] initWithFrame:CGRectMake(0,0, 320,44)];
search.showsCancelButton=YES;//显示取消按钮
search.autocapitalizationType=UITextAutocorrectionTypeNo;//大小写
self.searchBar=search;
self.tableView.tableHeaderView=search;//搜索栏显示在表格顶端
UISearchDisplayController * display=[[UISearchDisplayController alloc]initWithSearchBar:search contentsController:self];
display.searchResultsDataSource=self;
display.searchResultsDelegate=self;
//[display release];
[search release];
--------------------------------------------------------
//输入的搜索内容
NSPredicate * predicate=[NSPredicatepredicateWithFormat:@"SELF contains[cd] %@",self.searchBar.text];//cd不区分大小写 自身是否包含搜索栏的内容
self.filterArr=[self.colors.allKeyssortedArrayUsingSelector:@selector(compare:)];
self.filterArr=[self.filterArrfilteredArrayUsingPredicate:predicate];//筛选后的数组
- UISearchBar、UISearchDisplayController搜索
- IOS-模糊搜索UISearchBar+UISearchDisplayController
- UISearchDisplayController UISearchBar
- UISearchBar、UISearchDisplayController
- UISearchBar UISearchDisplayController
- UISearchBar和UISearchDisplayController
- IOS UISearchBar + UISearchDisplayController使用
- UISearchBar和UISearchDisplayController
- UISearchBar和UISearchDisplayController
- UISearchBar和UISearchDisplayController
- UISearchBar和UISearchDisplayController
- UISearchBar和UISearchDisplayController
- UISearchBar和UISearchDisplayController
- UISearchBar、UISearchDisplayController--(图)
- UISearchBar和UISearchDisplayController
- UISearchBar和UISearchDisplayController
- UISearchBar和UISearchDisplayController
- UISearchDisplayController 和 UISearchBar
- 一根雪糕引发的危机
- SAP Review Vendor Consignment
- hdu2689 Sort it (树状数组)
- ffmpeg入门之 Tutorial01
- eclipse 部署 openfire
- UISearchBar、UISearchDisplayController搜索
- java复制文件或文件夹
- SAP Review Vendor Subcontract
- LTE CQI
- Oracle在linux下的开机自启动(详细)
- 抛弃JS eval吧
- ural 1022. Genealogical Tree 拓扑排序
- jQuery找出所有没有disabled属性的checkbox
- Windows Phone Service References(服务引用)初探