• 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
CaseInsensitiveCompare:
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

CaseInsensitiveCompare:


  • Subject: CaseInsensitiveCompare:
  • From: Tony Cate <email@hidden>
  • Date: Sun, 27 Jan 2002 10:18:11 -0600

First off: It works fine. I just don't know why.

I have an object with three NSStrings. I store a bunch of the objects in an
array and sort using:

[myArray sortUsingSelector:@selector(caseInsensitiveCompare:)];

I had to override caseInsensitiveCompare: to tell it which field to sort on.

- (NSComparisonResult)caseInsensitiveCompare:(MyObject *)foo
{
return [sortField caseInsensitiveCompare:[foo sortField]];
}

It looks to me like the object is being compared to itself.


  • Prev by Date: Re: Stuck with NSURL
  • Next by Date: Re: [OT] An array of C-Strings
  • Previous by thread: gdb break on raise from Project Builder?
  • Next by thread: Customize Login Manager?
  • Index(es):
    • Date
    • Thread