Sent from my iPad
> On 21 Mar 2015, at 23:41, Jens Alfke <j...@mooseyard.com> wrote: > > >> On Mar 21, 2015, at 2:13 PM, Quincey Morris >> <quinceymor...@rivergatesoftware.com> wrote: >> >> Well, “String” is not “NSString”. > > Sure, but it’s bridged with NSString. The “Using Swift With Cocoa” book says: > “Swift automatically bridges between the String type and the NSString class. > This means that anywhere you use an NSString object, you can use a Swift > String type instead … you should almost never need to use the NSString class > directly in your own code.” But the bridging only happens if you import Foundation, otherwise there is no NSString to bridge with. > >> var str = "Hello, playground” as NSString >> str.cStringUsingEncoding(NSUTF8StringEncoding) // OK >> str.UTF8String // OK > > -cStringUsingEncoding: and several other NSString methods I’ve tried work > without the “as NSString” trick; what’s special about “UTF8String”? > > —Jens > _______________________________________________ > > 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/ktam%40yvs.eu.com > > This email sent to k...@yvs.eu.com _______________________________________________ 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