iphone - Sorting an Array of custom objects by a dictionary included in the custom object: How? -


I have an array of custom objects that includes a dictionary in things like this:

  CustomDataModel * Data Model; DataModel.NSString dataModel.NSDictionary dataModel.image  

I would like to sort one of the objects in the dictionary:

  dataModel.NSDictionary ObjectWithkey = @ " " 

The data model loads into an NSArray. I now want to sort the @ "name" key in the dictionary. Can it handle some NSSortDescriptor? Basic sort works fine, so far it is not understood ...

Your question is that 'It is completely clear to me, but you can try something like this on your NSArray:

  - (NSArray *) Sort items: (NSArray *) item; {NSSortDescriptor * sortNameDescriptor = [[[NSSortDescriptor alloc] initWithKey: @ "Names" ascending: No] Autoreclass]; NSArray * sortDescriptors = [[[NSArray alloc] initWithObjects: sortNameDescriptor, zero] autoreses]; Return [Items sorted by Desire descriptor: Sort descriptor]; }  

Comments

Popular posts from this blog

c# - How to capture HTTP packet with SharpPcap -

php - Multiple Select with Explode: only returns the word "Array" -

php - jQuery AJAX Post not working -