我手动将电子邮件ID添加到ABRecordRef,这会给我一个异常。查看代码
ABRecordRef person=ABPersonCreate();
NSString *email=@"adsasdads@sadad.com";
ABRecordSetValue(person,kABPersonEmailProperty,(__bridge CFTypeRef)email,NULL);
CFRelease(person);
答案 0 :(得分:1)
试试这个......
ABMutableMultiValueRef email = ABMultiValueCreateMutable(kABMultiStringPropertyType);
ABMultiValueAddValueAndLabel(email,(__bridge CFTypeRef)emailaddress,kABWorkLabel, NULL);
ABRecordSetValue(self.persons,kABPersonEmailProperty,email, NULL);
CFBridgingRelease(email);