获取 iPhone 上电话号码给出的姓名
我正在使用用户输入电话号码的文本字段。当 TextField 更改时,它应该检查该号码是否已在电话簿中并显示名称。
到目前为止,我唯一的方法是解析字典中的所有名称和数字并从那里读取它。
有没有更简单、更高效、更复杂的方法来做到这一点?
I'm using a TextField where the user types a phone number. When the TextField changes, it should check if this number is already in the phonebook and display the name.
So far, my only way is to parse all names and number in a Dict and read it from there.
Is there a simpler, more efficient and sophisticated way to do that?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
翻阅用户的地址簿并创建电话号码到人员的映射并不困难。 地址簿编程指南 列出了有关该框架如何工作的所有信息。
It wouldn't be hard to rip through the user's address book and create a phone number to person mapping. The Address Book Programming Guide lays out all the information on how the framework works.
在这里关闭并完成这个问题是我的解决方案的主要部分:
To close and complete this issue here is the main part of my solution: