sorting - iOS - Sort NSDictionay keys by sub value -


itemprop = "text">

I have an NSDictionary as the key code in the form of a currency and containing a NSTTIR (currency name) as the value One NSDAS + one NSRI (list of coins):

plist

< P> The goal is to sort NSDL with name-value to get NSARR with currency keys (AED, ARS, ...).

I know how to sort by keys and values, but it does not know how to sort an NSDictionary inside a value.

The following gives me the NSArray sorted with values, but I lose the keys:

  NSMutableArray * dictValues ​​= [[Self.currency All Values] ; [Sort by using leopardsCommunication: (NSCSpamator) ^ (NSDriver * A, NSustroyation * B) {nssting * key1 = [objectfork: @ "name"]; NSString * key2 = [B ObjectFor: @ "name"]; Return [compare key1: key2]; }];  

The key to convert a dictionary dictionary The key to inserting the key into the dictionary is the first step in the dictionary of the dictionary without losing anything. In other words, you must change this to

  root AED name "some name" objects. .. ARS name "alias" objects ...  

and then Call all values ​​ and And sort the resulting array


Comments

Popular posts from this blog

import - Python ImportError: No module named wmi -

Editing Python Class in Shell and SQLAlchemy -

lua - HowTo create a fuel bar -