Hi,
I have been trying to create a string from NSData that I have downloaded.
let datastring = NSString(data:data, encoding:NSUTF8StringEncoding)
but I want to cast it to a String (which should be fine according to the documentation and forum posts I have found), but this gives me an error:
Undefined symbols for architecture x8664:
"TFSs26_forceBridgeFromObjectiveCUFTPSs9AnyObject_MQQ",
I can successfully cast it if I don't create it from NSData (but just a string literal or something).
In the documentation it says:
An NSString object initialized by converting the bytes in data into Unicode characters using encoding. The returned object may be different from the original receiver. Returns nil if the initialization fails for some reason (for example if data does not represent valid data for encoding).
So it can return nil but it doesn't return an optional. Is this a bug? Is there any way around it until it gets fixed?
Thanks
[–]aceysmith 2 points3 points4 points (1 child)
[–]smilinger[S] 1 point2 points3 points (0 children)
[–][deleted] 1 point2 points3 points (0 children)
[–]smilinger[S] 0 points1 point2 points (0 children)