Re: Why is NSString.UTF8String unavailable in Swift?
Re: Why is NSString.UTF8String unavailable in Swift?
- Subject: Re: Why is NSString.UTF8String unavailable in Swift?
- From: Quincey Morris <email@hidden>
- Date: Sat, 21 Mar 2015 21:13:39 +0000
On Mar 21, 2015, at 14:02 , Jens Alfke <email@hidden> wrote:
>
> let s = “……”
> some_function(s.UTF8String)
Well, “String” is not “NSString”.
So:
import Cocoa
var str = "Hello, playground” as NSString
str.cStringUsingEncoding(NSUTF8StringEncoding) // OK
str.UTF8String // OK
_______________________________________________
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