Re: cannot invoke 'substringToIndex' with an argument list of type '(Int)'
Re: cannot invoke 'substringToIndex' with an argument list of type '(Int)'
- Subject: Re: cannot invoke 'substringToIndex' with an argument list of type '(Int)'
- From: Quincey Morris <email@hidden>
- Date: Tue, 07 Jul 2015 07:31:23 +0000
On Jul 7, 2015, at 00:22 , Roland King <email@hidden> 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@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