我使用此代码,因为kABPersonEmailProperty
它有效,但kABPersonLastNameProperty
不是。为什么?
NSMutableArray *allNumbers = [[NSMutableArray alloc] initWithCapacity:CFArrayGetCount(people)];
for (CFIndex i = 0; i < CFArrayGetCount(people); i++) {
ABRecordRef person2 = CFArrayGetValueAtIndex(people, i);
ABMultiValueRef numbers = ABRecordCopyValue(person2, kABPersonLastNameProperty);
for (CFIndex j=0; j < ABMultiValueGetCount(numbers); j++) {
NSString* number = (NSString *)CFBridgingRelease(ABMultiValueCopyValueAtIndex(numbers, j));
[allNumbers addObject:number];
}
CFRelease(numbers);
}