Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
在我的应用程序中,我使用 addressbookui 导入联系人详细信息。如果电子邮件或手机号码为空,我的应用程序会崩溃。
对于电子邮件,试试这个:
ABMutableMultiValueRef eMail = ABRecordCopyValue(ref, kABPersonEmailProperty); if(ABMultiValueGetCount(eMail) > 0) { NSString *personEmail = (NSString *)ABMultiValueCopyValueAtIndex(eMail, 0); }