简体   繁体   English

iPhone SDK:从电话号码获取联系人姓名

[英]iPhone SDK: Getting Contact's Name from the Phone Number

Does anyone know if there is a preferred method to find a contact's name in the Address book using their phone number as the key? 有没有人知道是否有一种首选方法可以使用电话号码作为密钥在地址簿中查找联系人姓名?

It seems that this should be a standard function since it is done in several places by the phone, such as in Recent Calls, Voice Mail list, Incoming Call ID, etc. 看起来这应该是标准功能,因为它是通过电话在几个地方完成的,例如在最近通话,语音邮件列表,来电ID等中。

Thanks, Anthony 谢谢,安东尼

Unfortunately the only way to do it is to enumerate through all the contacts, enumerate through each contacts phone numbers, and check each one until you find a hit. 不幸的是,唯一的方法是枚举所有联系人,枚举每个联系人的电话号码,并检查每个联系人,直到找到命中。 If you think there should be a built in way to query by phone number directly you should file a feature request. 如果您认为应该有一种内置的方式来直接通过电话号码查询,那么您应该提交功能请求。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM