func convertCfTypeToString(cfValue: Unmanaged<AnyObject>!) -> String?{
let value = Unmanaged.fromOpaque(
cfValue.toOpaque()).takeUnretainedValue() as CFString
if CFGetTypeID(value) == CFStringGetTypeID(){
return value as String
} else {
return nil
}
}
用途:
let value = convertCfTypeToString(cfValue: ABMultiValueCopyValueAtIndex(multivalue, 0))
4条答案
按热度按时间ny6fqffe1#
试试这个:
u7up0aaq2#
pengsaosao3#
尝试使用此函数将Unmanaged转换为Stirng
用途:
vh0rcniy4#
布尔