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

Re: NSComparisonResult


  • Subject: Re: NSComparisonResult
  • From: Steve Christensen <email@hidden>
  • Date: Fri, 6 Feb 2004 07:31:27 -0800

On Feb 5, 2004, at 8:43 PM, April Gendill wrote:

Are there any examples of how to use NSComparisonResult with an array of dictionaries when you only need to compare a single item in the dict.

Sure:

int CompareDictionaries(id item1, id item2, void* context)
{
NSString* string1 = [item1 objectForKey:@"SomeKey"];
NSString*string2 = [item2 objectForKey:@"SomeKey"];

return [string1 localizedCaseInsensitiveCompare: string2];
}

...

- (void) sortArray
{
[myArray sortUsingFunction: CompareDictionaries context:nil];
}
_______________________________________________
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: 
 >NSComparisonResult (From: April Gendill <email@hidden>)

  • Prev by Date: Entering UniCode
  • Next by Date: Sending a CGI request and getting result
  • Previous by thread: NSComparisonResult
  • Next by thread: Stopping a NSView from drawing in -drawRect
  • Index(es):
    • Date
    • Thread