gpt4 book ai didi

iphone - filterContentForSearchText 委托(delegate)方法中的 "scope"参数应包含什么?

转载 作者:行者123 更新时间:2023-11-29 04:17:16 26 4
gpt4 key购买 nike

我已经在 UISearchDisplayDelegate 中实现了 filterContentForSearchText 方法。

我可以看到 (NSString*)searchText 是我在文本字段中写入的文本,但作用域返回 NULL。我应该为范围提供什么参数?

最佳答案

范围是您正在搜索的“区域”(如果您已经实现了它)。例如

Search with scope bar

然后,您可以将相关范围传递给 filterContentForSearchText:scope:,如下所示:

[self filterContentForSearchText:searchString 
scope:[[self.searchDisplayController.searchBar scopeButtonTitles] objectAtIndex:[self.searchDisplayController.searchBar selectedScopeButtonIndex]]];

这取自 Apple's TableSearch sample code .

关于iphone - filterContentForSearchText 委托(delegate)方法中的 "scope"参数应包含什么?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13508593/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com