CaseInsensitiveCompare:
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.