问题
I want to read the name of an ABSource in the addressBook framework. Is this possible? The following code sample leaves me with null, while the currentSource pointer is valid.
NSString* stringName = (NSString*)ABRecordCopyValue(currentSource, kABSourceNameProperty);
Thank you in advance, Martin
回答1:
NSString *sourceTypeName = (NSString *)((CFStringRef)ABRecordCopyValue(source, kABSourceNameProperty));
ABSourceType sourceType = [(NSNumber *)ABRecordCopyValue(currentSource, kABSourceTypeProperty) intValue];
See ABSourceType for values.
来源:https://stackoverflow.com/questions/5297576/read-name-of-absource