gpt4 book ai didi

iphone - 我们可以从 iPhone 的联系人列表中访问电子邮件 ID 吗?

转载 作者:行者123 更新时间:2023-11-29 11:21:32 25 4
gpt4 key购买 nike

我们可以通过代码获取 iPhone 联系人列表中每个联系人的所有电子邮件 ID 吗?

最佳答案

您将通过给定的代码获得个人电子邮件 ID...

    ABAddressBookRef addressBook = ABAddressBookCreate();
CFArrayRef people = ABAddressBookCopyArrayOfAllPeople(addressBook);
NSString *contactName = lblTitle.text;
for(int i = 0;i<ABAddressBookGetPersonCount(addressBook);i++)
{
ABRecordRef person = CFArrayGetValueAtIndex(people, i);
NSString *strEmail = [arContactData valueForKey:@"Email"];
NSMutableArray *arEmailList = [[NSMutableArray alloc] init];
ABMultiValueRef emails = ABRecordCopyValue(person, kABPersonEmailProperty);
for(CFIndex idx = 0; idx < ABMultiValueGetCount(emails); idx++)
{
CFStringRef emailRef = ABMultiValueCopyValueAtIndex(emails, idx);
NSString *strLbl = (NSString*)ABAddressBookCopyLocalizedLabel (ABMultiValueCopyLabelAtIndex (emails, idx));
NSDictionary *dicTemp = [[NSDictionary alloc]initWithObjectsAndKeys:strEmail,@"value", strLbl,@"label", nil];
[arEmailList addObject:dicTemp];
}
}

关于iphone - 我们可以从 iPhone 的联系人列表中访问电子邮件 ID 吗?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6930019/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com