我必须使用“联系人创建日期”导出iOS设备联系人数据并进行过滤。是否可以使用Objective C?
答案 0 :(得分:1)
您可以获得任何联系人的创建日期,如下所示
ABAddressBookRef addressBookRef = ABAddressBookCreateWithOptions(NULL, NULL);
ABAddressBookRef addressBook = ABAddressBookCreateWithOptions(NULL, err);
CFArrayRef allPeople = ABAddressBookCopyArrayOfAllPeople(addressBook);
ABRecordRef person = CFArrayGetValueAtIndex( allPeople, 0 );
NSDate* createDate = (__bridge NSDate*) ABRecordCopyValue( person, kABPersonCreationDateProperty);
NSDate* updateDate = (__bridge NSDate*) ABRecordCopyValue( person, kABPersonModificationDateProperty);