How can i create a CFString from a native swift String or NSString in swift
let path:String = NSBundle.mainBundle().pathForResource(name.stringByDeleting
You cast it between CFString and NSString, or between NSString and String. The trick is that you must double cast when going between CFString and String.
This works:
var cfstr: CFString = "Why does Swift require double casting!?"
var nsstr: NSString = cfstr as NSString
var str: String = nsstr as String
This gives the error "'CFString' is not a subtype of 'NSString'":
var cfstr: CFString = "Why does Swift require double casting!?"
var str: String = cfstr as String