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: Jens Alfke <email@hidden>
- Date: Sat, 21 Mar 2015 18:46:56 -0700
> On Mar 21, 2015, at 4:58 PM, Quincey Morris <email@hidden> wrote:
>
> When you used “cStringUsingEncoding”, you weren’t bridging to the NSString method, you were using String’s native method of the same name.
Aha. That was not at _all_ clear from the docs. The implication there is that String inherits all methods of NSString, not that most of the NSString methods have been manually copied into String.
> It’s possible that String’s cStringUsingEncoding is internally calling through to NSString’s, but I wouldn’t bet on it.
I'd bet money on it, actually. There's no reason for them to rewrite those methods. And the annotation "[Foundation]" on many of the String method docs surely means that they're bridged to the NSString implementations.
Anyway, thanks for clearing that up.
--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