• 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
NSString's compare:options: and NSNumericSearch. Huh?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

NSString's compare:options: and NSNumericSearch. Huh?


  • Subject: NSString's compare:options: and NSNumericSearch. Huh?
  • From: Manfred Schubert <email@hidden>
  • Date: Sun, 4 Dec 2005 00:44:07 +0100

The header of NSString says about NSNumericSearch:

/* Added in 10.2; Numbers within strings are compared using numeric value, that is, Foo2.txt < Foo7.txt < Foo25.txt; only applies to compare methods, not find */

So then if I do:

result = [@"Foo2.txt" compare:@"Foo7.txt" options:NSNumericSearch];

I correctly get NSOrderedAscending, but for

result = [@"Foo7.txt" compare:@"Foo25.txt" options:NSNumericSearch];

I get NSOrderedDescending.

What am I missing here?


Manfred
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden
  • Follow-Ups:
    • Re: NSString's compare:options: and NSNumericSearch. Huh?
      • From: Ricky Sharp <email@hidden>
  • Prev by Date: Re: Is Apple's singleton sample code correct?
  • Next by Date: Re: NSString's compare:options: and NSNumericSearch. Huh?
  • Previous by thread: Re: WebKit+SVG ready for mainline
  • Next by thread: Re: NSString's compare:options: and NSNumericSearch. Huh?
  • Index(es):
    • Date
    • Thread