On Jul 7, 2015, at 00:22 , Roland King <[email protected]> wrote:
> 
> If you want to use an NSString method with the same name as a String one, 
> cast to an NSString, ( s as NSString )

The other thing to be really, really careful of when bridging is that all 
indexes and ranges derived from NSString API are counting by UTF-16 code 
units**, as they’ve always done. Indexes and ranges derived from String API are 
counting by graphemes.


** At least, that was the situation in Swift 1.2. I haven’t looked into what’s 
changed with NSString bridging in Swift 2, but I suspect caution is still 
advisable.



_______________________________________________

Cocoa-dev mailing list ([email protected])

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 [email protected]

Reply via email to