有没有办法在创建/添加联系人时获取时间戳。我想按时间顺序对联系人列表进行排序
答案 0 :(得分:0)
您有联系人的创建日期属性
NSArray *allPeople = ((__bridge_transfer NSArray *)ABAddressBookCopyArrayOfAllPeople(addresbook));
for (int i = 0; i < allPeople.count; i++) {
ABRecordRef *person = (ABAddressBookRef *)[allPeople objectAtIndex:i];
NSDate *creationDate = ((__bridge_transfer NSDate*)ABRecordCopyValue(person, kABPersonCreationDateProperty));
NSLog(@"Creation date: %@ of entry: %@", creationDate, person);
}