Re: Need to force Lex-Order?
Re: Need to force Lex-Order?
- Subject: Re: Need to force Lex-Order?
- From: Sherm Pendley <email@hidden>
- Date: Thu, 31 Jul 2003 22:55:51 -0400
On Thursday, July 31, 2003, at 10:39 PM, Michael Hanna wrote:
Hello, I've written a Dictionary in plist format, in which I need to
access the NSArrays in lex-order. However when I get allKeys:
You cannot depend on dictionary keys being stored or returned in any
particular order.
Assuming that your dictionary keys are strings, as they appear to be,
you can easily get a sorted list of keys with:
keyArray = [[theDict allKeys]
sortedArrayUsingSelector:@selector(caseInsensitiveCompare:)];
If your keys are other object types, you'll need to use some other
sortedArray... variant, but the principle will be the same.
sherm--
_______________________________________________
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.