• 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: cannot invoke 'substringToIndex' with an argument list of type '(Int)'
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


References: 
 >cannot invoke 'substringToIndex' with an argument list of type '(Int)' (From: Rick Mann <email@hidden>)
 >Re: cannot invoke 'substringToIndex' with an argument list of type '(Int)' (From: Roland King <email@hidden>)

  • Prev by Date: Re: cannot invoke 'substringToIndex' with an argument list of type '(Int)'
  • Next by Date: Re: cannot invoke 'substringToIndex' with an argument list of type '(Int)'
  • Previous by thread: Re: cannot invoke 'substringToIndex' with an argument list of type '(Int)'
  • Next by thread: Re: cannot invoke 'substringToIndex' with an argument list of type '(Int)'
  • Index(es):
    • Date
    • Thread