我有以下cpde:改变ABRecordRef财产
ABRecordRef person = ABAddressBookGetPersonWithRecordID(addressBook, ABRecordGetRecordID(self.recordRef_));
CFErrorRef error = NULL;
if ([self.nameTextField_.text isNotNull]){
NSArray *nameStringArray = [self.nameTextField_.text componentsSeparatedByCharactersInSet:[NSCharacterSet whitespaceCharacterSet]];
ABRecordSetValue(person, kABPersonFirstNameProperty, (__bridge CFTypeRef)([nameStringArray objectAtIndex:0]), NULL);
if ([nameStringArray count] > 1){
ABRecordSetValue(person, kABPersonLastNameProperty, (__bridge CFTypeRef)([nameStringArray lastObject]), &error);
}
}
但是,此代码它给我这个错误后:
Error Domain=ABAddressBookErrorDomain Code=0 "The operation couldn’t be completed. (ABAddressBookErrorDomain error 0.)"
任何想法,这是为什么?