How to convert a swift String to CFString

Just cast it: var str = “Hello, playground” as CFString NSString(format: “type id: %d”, CFGetTypeID(str)) Note that you’ll need import Foundation for cast as CFString to work. Otherwise if you only have import CoreFoundation, you’ll need to force cast as! CFString.

How to convert CFStringRef to NSString?

NSString and CFStringRef are “Toll free bridged”, meaning that you can simply typecast between them. For example: CFStringRef aCFString = (CFStringRef)aNSString; works perfectly and transparently. Likewise: NSString *aNSString = (NSString *)aCFString; The previous syntax was for MRC. If you’re using ARC, the new casting syntax is as follows: NSString *aNSString = (__bridge NSString *)aCFString; works … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)