ABAdressbook 从电话号码获取全名
你好 我想搜索 ABAdressbook 并获取给定电话号码的姓名? 我怎样才能做到这一点?
Hi
I want to search the ABAdressbook and get the name from a given telephone number?
How can I do that?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
你不能。
与
ABAdressBook
交互的方式只有几种。最重要的是通过提供 ID 和 ABPeoplePickerNavigationControllerDelegate。看来,这是出于隐私原因,因此从 AB 获取信息的唯一方法是通过用户。
编辑:
也许我错了......看看这个 可以帮助你。
You can't.
There are just a few ways of interacting with
ABAdressBook
.The most impartant ones are saving or deleting
ABPerson
entrys by giving IDs and the ABPeoplePickerNavigationControllerDelegate. It seems, this is for reasons of privacy, so that the only way to get info out of th AB is over the user.EDIT:
Maybe i was wrong... check out if this helps you.
看看 https://github.com/erica/ABContactHelper
有一个名为contactsMatchingPhone 的方法,这就是您想要使用的方法。
然后,您可以使用 ABContact 帮助程序来迭代结果。
look at https://github.com/erica/ABContactHelper
there is a method called contactsMatchingPhone which is what you want to use.
You can then use the ABContact helper to iterate through the results.