目标C:如何实现“自动完成”功能(如谷歌搜索) [英] Objective C: How to implement 'auto complete' feature (like google search)
问题描述
我想实现一个具有自动完成功能(如谷歌搜索)搜索,如下面的截图中看到:
I want to implement a search with a auto-complete feature (like google search) as seen in the screenshot below:
例如,如果我的汽车钥匙,启动或含自动将显示在表格中结果列表
For example if I key auto, a list of results starting or containing auto will be displayed in the table
是否有任何教程或可用资源供我参考?
Are there any tutorials or resources available for my reference?
推荐答案
如果你只有一组内部要用于自动完成字符串的,即你是不是想从互联网动态抓取。然后,我创建了我都忍了在GitHub上一个类,西港岛线把每个用字符串开头,例如,@猫将返回字符串{@猫,@目录,@类别}。
If you have just an internal set of string you want autocompletion for, i.e. you are not trying to dynamically fetch them from the internet. Then I have created a class which I have put up on GitHub that wil turn every string that begins with a string, for example, @"cat" would return {@"cat", @"catalog", @"category"}.
这篇关于目标C:如何实现“自动完成”功能(如谷歌搜索)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!