this.
ABRecordRef aRecord = ABPersonCreate();
CFErrorRef anError = NULL;
ABRecordSetValue(aRecord, kABPersonFirstNameProperty,
CFSTR("Jijo"), &anError);
ABRecordSetValue(aRecord, kABPersonLastNameProperty,
CFSTR("Pulikkottil"), &anError);
if (anError != NULL) {
NSLog(@"error while creating..");
}
CFStringRef firstName, lastName;
firstName = ABRecordCopyValue(aRecord, kABPersonFirstNameProperty);
lastName = ABRecordCopyValue(aRecord, kABPersonLastNameProperty);
ABAddressBookRef addressBook;
CFErrorRef error = NULL;
addressBook = ABAddressBookCreate();
BOOL isAdded = ABAddressBookAddRecord (
addressBook,
aRecord,
&error
);
if(isAdded){
NSLog(@"added..");
}
if (error != NULL) {
NSLog(@"ABAddressBookAddRecord %@", error);
}
error = NULL;
BOOL isSaved = ABAddressBookSave (
addressBook,
&error
);
if(isSaved){
NSLog(@"saved..");
}
if (error != NULL) {
NSLog(@"ABAddressBookSave %@", error);
}
CFRelease(aRecord);
CFRelease(firstName);
CFRelease(lastName);
CFRelease(addressBook);
당신이 거기에 데이터를 저장해야하는 경우
, 나는 당신의 유일한 옵션은
kABPersonNoteProperty
생각하지만, 나는이에 어떤 전문가는 아니지만.
편집 : link.
답변 :
편집 : 사용자에게 완료 주소록 항목을 추가하라는 메시지를 표시 할 수도 있습니다 (here).
아래의 모든 해결책은 연락처 목록에 세부 정보를 추가하는 데 필요한 jst입니다. 커 스턴 필드 추가에 도움이 필요합니다. –