Re: Init String with bytes
Re: Init String with bytes
- Subject: Re: Init String with bytes
- From: Jens Alfke <email@hidden>
- Date: Fri, 31 Jul 2015 12:51:23 -0700
> On Jul 31, 2015, at 12:32 PM, Jan E. Schotsman <email@hidden> wrote:
>
> But the NSString Reference says:
> convenience init?(bytes bytes: UnsafePointer<Void>, length length: Int, encoding encoding: UInt )
NSString ≠ String. It’s not toll-free bridging like you’re used to with CF. String and NSString are actually different classes, though there are automatic conversions between them, and some (but not all) NSString methods are shadowed in String.
Your code should work if you change String(…) to NSString(…).
—Jens
_______________________________________________
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