简体   繁体   中英

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.

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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