问题
How do I get the name of an ABSource object? Using the following code, the name returns nil.
ABAddressBookRef addressBook = ABAddressBookCreate();
for (id object in [(NSArray *)ABAddressBookCopyArrayOfAllSources(addressBook) autorelease]) {
ABRecordRef source = (ABRecordRef)object;
NSString *sourceTypeName = (NSString *)((CFStringRef)ABRecordCopyValue(source, kABSourceNameProperty));
NSLog(@"name: %@", sourceTypeName);
}
CFRelease(addressBook);
回答1:
Here, you have an example of code to retrieve ABSource and ABSourceType.
来源:https://stackoverflow.com/questions/5527905/absource-name-returning-nil