On Mar 21, 2015, at 18:55 , Charles Srstka <cocoa...@charlessoft.com> wrote:
> 
> The thing that’s odd is that the native Swift String’s implementation of 
> cStringUsingEncoding uses the Foundation NSStringEncoding constants instead 
> of something that wouldn’t require importing Foundation.

> On Mar 21, 2015, at 18:46 , Jens Alfke <j...@mooseyard.com> wrote:
> 
> The implication there is that String inherits all methods of NSString, not 
> that most of the NSString methods have been manually copied into String.


One more thing…

Jens is correct, actually. If you remove the “import Cocoa” from the 
playground, you’ll see that the basic String class doesn’t even have 
cStringUsingEncoding. (!)

So, I conclude, importing NSString.h:

— adds NSString methods to class String as an extension, AND

— adds an entirely new NSString class with the NSString methods, BUT

— for some reason, omits UTF8String in the first case, but adds it in the 
second case.




_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to