• 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: Abba madness compare:options:range:
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Abba madness compare:options:range:


  • Subject: Re: Abba madness compare:options:range:
  • From: Pete Yandell <email@hidden>
  • Date: Tue, 16 Sep 2003 10:55:18 +1000

On Tuesday, September 16, 2003, at 09:25 AM, Jacob Engstrand wrote:

> This call returns NSOrderedSame
>
> [@"Abba" compare: @"abba"
> options: NSCaseInsensitiveSearch
> range: NSMakeRange(0, 4)];
>
>
> But this call returns NSOrderedDescending
>
> [@"Abba" compare: @"abba"
> options: NSCaseInsensitiveSearch
> range: NSMakeRange(0, 3)];
>
>
> As I understand it, the first call compares "Abba" and "abba"
> disregarding case and so it regards them as being equal. Fine.
>
> The second call compares "Abb" and "abb" disregarding case and yet it
> returns saying they are not equal.

From the docs got compare:options:range:locale:

...Returns NSOrderedAscending if the substring of the receiver given by
range precedes aString in lexical ordering...

So you're actually comparing "Abb" to "abba" in the second call.

Pete Yandell
http://pete.yandell.com/
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.

References: 
 >Abba madness compare:options:range: (From: Jacob Engstrand <email@hidden>)

  • Prev by Date: Abba madness compare:options:range:
  • Next by Date: Using NSArchiver with NSDocument
  • Previous by thread: Abba madness compare:options:range:
  • Next by thread: Using NSArchiver with NSDocument
  • Index(es):
    • Date
    • Thread