Read name of ABSource

99封情书 提交于 2019-12-11 06:13:45

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!