ABAdressbook 从电话号码获取全名

发布于 2024-10-25 01:47:50 字数 55 浏览 8 评论 0原文

你好 我想搜索 ABAdressbook 并获取给定电话号码的姓名? 我怎样才能做到这一点?

Hi
I want to search the ABAdressbook and get the name from a given telephone number?
How can I do that?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

§普罗旺斯的薰衣草 2024-11-01 01:47:50

你不能。
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.

淑女气质 2024-11-01 01:47:50

看看 https://github.com/erica/ABContactHelper
有一个名为contactsMatchingPhone 的方法,这就是您想要使用的方法。

NSArray *match = [ABContactsHelper contactsMatchingPhone:@"your number"];

然后,您可以使用 ABContact 帮助程序来迭代结果。

look at https://github.com/erica/ABContactHelper
there is a method called contactsMatchingPhone which is what you want to use.

NSArray *match = [ABContactsHelper contactsMatchingPhone:@"your number"];

You can then use the ABContact helper to iterate through the results.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文