Sorting
Sorting
- Subject: Sorting
- From: "Peter Karlsson" <email@hidden>
- Date: Wed, 16 Feb 2005 10:34:33 +0100
Dear list!
I have a .plist file looking like this:
<array>
<dict>
<key>name</key>
<string>NINA </string>
<key>idnumber</key>
<string>1</string>
<key>keyword</key>
<string>Bass, String, Bell</string>
</dict>
<dict>
<key>name</key>
<string>HRPORG</string>
<key>idnumber</key>
<string>2</string>
<key>keyword</key>
<string>Organ, Synth</string>
</dict>
<dict>
<key>name</key>
<string>PLKATK</string>
<key>idnumber</key>
<string>3</string>
<key>keyword</key>
<string>Whistle</string>
</dict>
</array>
I want to sort it in alphabetical order, and sort it by key 'name'. How do
I do that?
I'm using this code to sort arrays:
[myMutableArray sortUsingSelector:@selector(compareNumerically:)];
- (NSComparisonResult)compareNumerically:(NSString *)string
{
return [self compare:string options:(NSNumericSearch |
NSCaseInsensitiveSearch)];
}
And it works very good. Can it be modified to do the same thing with the
contents of my .plist file?
Best regards Peter
_______________________________________________
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