Init String with bytes
Init String with bytes
- Subject: Init String with bytes
- From: "Jan E. Schotsman" <email@hidden>
- Date: Fri, 31 Jul 2015 21:32:42 +0200
Hello,
This has me puzzled: I am trying to initialize a Swift string with an
NSData but the analyzer denies my approach.
let dataValue:NSData = …
let name = String( bytes:dataValue.bytes, length:dataValue.length,
encoding:NSUTF8StringEncoding )
Analyzer complains: "Cannot find an initializer for type 'String' that
accepts an argument list of type '(bytes: UnsafePointer<Void>, length:
Int, encoding: UInt)'"
But the NSString Reference says:
convenience init?(bytes bytes: UnsafePointer<Void>, length length:
Int, encoding encoding: UInt )
Anyone?
Jan E.
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden