• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Why is NSString.UTF8String unavailable in Swift?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


References: 
 >Why is NSString.UTF8String unavailable in Swift? (From: Jens Alfke <email@hidden>)
 >Re: Why is NSString.UTF8String unavailable in Swift? (From: Quincey Morris <email@hidden>)
 >Re: Why is NSString.UTF8String unavailable in Swift? (From: Jens Alfke <email@hidden>)
 >Re: Why is NSString.UTF8String unavailable in Swift? (From: Quincey Morris <email@hidden>)

  • Prev by Date: Re: Why is NSString.UTF8String unavailable in Swift?
  • Next by Date: Re: Why is NSString.UTF8String unavailable in Swift?
  • Previous by thread: Re: Why is NSString.UTF8String unavailable in Swift?
  • Next by thread: Re: Why is NSString.UTF8String unavailable in Swift?
  • Index(es):
    • Date
    • Thread