我如何从swift中的本机swift String或NSString创建一个CFString
let path:String = NSBundle.mainBundle().pathForResource(name.stringByDeletingPathExtension,ofType:"pdf") let string:CFString = ??? path let url:CFURLRef = CFURLCreateWithFileSystemPath(allocator:kcfAllocatorDefault,filePath:string,pathStyle:CFURLPathStyle.CFURLPOSIXPathStyle,isDirectory:false)
只是投下它:
原文链接:https://www.f2er.com/swift/320407.htmlvar str = "Hello,playground" as CFString NSString(format: "type id: %d",CFGetTypeID(str))