iOS学习爬坑记录4:ios8中的搜索栏,使用UISearchController
来源:互联网 发布:python 类型转换 编辑:程序博客网 时间:2024/06/05 04:09
问题提出,今天在看《Begining iOS 7 Development Exploring the iOS SDK》第八章为表格添加搜索栏的时候出现的,书中说使用如下代码创建:
filteredNames = [NSMutableArray array]; UISearchBar *searchBar = [[UISearchBar alloc] initWithFrame:CGRectMake(0, 0, 320, 44)]; tableView.tableHeaderView = searchBar; searchController = [[UISearchDisplayController alloc] initWithSearchBar:searchBar contentsController:self]; searchController.delegate = self; searchController.searchResultsDataSource = self;
我的编译器,Xcode 6.1 发警告, 'UISearchDisplayController' is deprecated: first deprecated in iOS 8.0 - UISearchDisplayController has been replaced with UISearchController
原来在ios 8的API中,被换成了UISearchController,但上面的例子在iOS 8.1内核的模拟器上可以运行 ,于是我有了一个疑问,这个问题我再cocoachina的论坛上提了,希望明白的人能指导下,链接:http://www.cocoachina.com/bbs/read.php?tid=271816&page=e&#a
UISearchController的疑问,求指导
是这样的,在ios 8之前用UISearchDisplayController创建搜索栏,在iOS 8之后用UISearchController,我想问,如果我用UISearchDisplayController创建的搜索栏,能在iOS 8系统上正常运行吗?又或者,如果我用UISearchController创建的搜索栏,能在iOS 8以下的系统正常运行吗?如果答案是否,那我要兼容iOS 7和8,该怎么样来实现搜索栏呢?谢谢
这是个问题暂时还没得到解答,
关于UISearchController的使用,kilik52在github上上传了一个简单示例,可以参考一下,链接:https://github.com/kilik52/UISearchControllerExampleMinimal
0 0
- iOS学习爬坑记录4:ios8中的搜索栏,使用UISearchController
- iOS --- 搜索框UISearchController的使用(iOS8.0以后替代UISearchBar + UISearchDisplayController的组合)
- iOS - 搜索框UISearchController的使用(iOS8.0之后替代UISearchBar + UISearchDisplayController的组合)
- iOS开发-搜索栏 UISearchController
- UISearchController IOS8之后推荐使用的搜索控件
- [iOS学习]搜索框(UISearchController)最近踩过的坑
- IOS-搜索功能实现, UIsearchController的使用
- iOS开发 搜索栏UISearchBar和UISearchController
- iOS开发-搜索栏UISearchBar和UISearchController
- iOS开发-搜索栏UISearchBar和UISearchController
- iOS开发-搜索栏UISearchBar和UISearchController
- iOS开发-搜索栏UISearchBar和UISearchController
- iOS开发-搜索栏UISearchBar和UISearchController
- iOS--搜索UISearchController&&UISearchDisplayController
- iOS: 搜索控件UISearchController
- [iOS学习]之UISearchController简单使用
- iOS中的两种搜索方式UISearchDisplayController和UISearchController
- UI_搜索框UISearchController的使用(iOS8.0以后替代UISearchBar + UISearchDisplayController)
- 人品计算器
- Shell脚本的test命令用法
- 三大物体识别算法--SIFT/SURF、haar特征、广义hough变换的特性深入剖析
- 树莓派通过GPIO控制步进电机(python)
- SQL基础日记3
- iOS学习爬坑记录4:ios8中的搜索栏,使用UISearchController
- 新疆阿勒泰雪后现"幻日"奇景
- 第十四周OJ项目2-国家排序
- Maven Dubbo zookeeper 初探
- Jieba分词包(二)——trie树和DAG
- 详解coredump
- iOS基础1:NSDictionary和NSMutableDictionary 的详解
- 使用C语言操作Mysql数据库
- devexpress SchedulerControl 的schedulerControl_CustomDrawAppointment