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

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


  • Subject: Re: NSString's compare:options: and NSNumericSearch. Huh?
  • From: Ricky Sharp <email@hidden>
  • Date: Sat, 3 Dec 2005 18:21:01 -0600


On Dec 3, 2005, at 5:44 PM, Manfred Schubert wrote:

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?

I just tried the above and in both cases the result is NSOrderedAscending. My OS (10.4.3) uses US English and Number Format is also set to US.

___________________________________________________________
Ricky A. Sharp mailto:email@hidden
Instant Interactive(tm) http://www.instantinteractive.com

_______________________________________________
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: Manfred Schubert <email@hidden>
References: 
 >NSString's compare:options: and NSNumericSearch. Huh? (From: Manfred Schubert <email@hidden>)

  • Prev by Date: NSString's compare:options: and NSNumericSearch. Huh?
  • Next by Date: Re: Releasing all nib objects [Was: instantiateNibWithOwner:topLevelObjects: usage]
  • Previous by thread: NSString's compare:options: and NSNumericSearch. Huh?
  • Next by thread: Re: NSString's compare:options: and NSNumericSearch. Huh?
  • Index(es):
    • Date
    • Thread