1
我想使用UISearchController来过滤PFObjects数组。带有Parse对象的UISearchController?
var customers:[PFObjects] = [PFObjects]() //this is full of my objects.
var searchText:[PFObject] = [PFObjects]() //this has my searchTexts.
我在我的客户类中有一个名为“searchText”的专栏,其中包含我的所有客户姓名,地址和电话号码。我想弄清楚如何填充搜索文本数组,然后通过这两个数组进行筛选。 我有我所有的tableview代表和数据源设置和uisearchcontroller初始化。
func updateSearchResultsForSearchController(searchController: UISearchController) {
//How do i search through the array of searchTexts and the customers array?
}
我可能会试图通过我的pfobjects数组筛选标记...所以任何帮助表示赞赏谢谢!
嘿芽,是searchObject应该是我的解析类中的Searchtexts数组?我无法让searchObject.rangeOfString工作。 –
是的,searchObject来自你的Parse对象数组,我不知道它有什么字段,所以你需要从它得到字符串,然后执行'rangeOfString' – njuri