NSTokenField 建议但未完成
我觉得这一定是一个常见问题,我只是在努力弄清楚,但我找不到其他人问这个问题,所以...... 基本上,我有一个 NSTokenField,当用户开始输入时,我会发出 SOAP 请求并获取与他们输入的内容相似的名称。问题是我的建议不一定与他们输入的内容相符。例如,我匹配电子邮件和姓氏,但人的全名出现在建议数组中。由于字母不匹配,NSTokenField 会将已输入的内容更改为数组中的第一项。有没有办法关闭自动完成并只显示建议框?
I feel like this must be a common issue that I'm just struggling to figure out, but I couldn't find anyone else who asked the question so...
Basically I have an NSTokenField and when the user begins typing I make a SOAP request and get names that are similar to what they have entered. The issue is my suggestions don't necessarily match what they have typed. For example, I match email and last names, but a persons full name appears in the suggestion array. Since the letters don't match, NSTokenField changes what has already been typed to the first item in the array. Is there a way to turn off autocomplete and just have the suggestion box appear?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
事实证明,我错误地分配了 selectedIndex,但如果您将其设置为 -1,则不会选择任何内容。
It turns out that I was assigning selectedIndex incorrectly but if you just set it to -1 then nothing is selected.
很快答案是:
In swift the answer is: