Hello,
I am parsing an XML and storing all data in NSMutableArray in form of Dictionary.
NSMutableArray * stories;
// a temporary item; added to the "stories" array one at a time,
// and cleared for the next one
NSMutableDictionary * item;
- (void)parser:(NSXMLParser *)parser
didEndElement:(NSString *)elementName
namespaceURI:(NSString *)namespaceURI
qualifiedName:(NSString *)qName
{
if ([elementName isEqualToString:@"item"])
{
// save values to an item, then store that item into the array...
[item setObject:currentTitle forKey:@"title"];
[item setObject:currentLink forKey:@"link"];
[item setObject:currentSummary forKey:@"summary"];
[item setObject:currentDate forKey:@"date"];
//Numeric value for sorting
[item setObject:rates forKey:@"rates"];
[stories addObject:[item copy]];
}
}
Once I am done with parsing, I need to sort array by "rates" which is numeric filed. Please suggest.