iphone - NSDictionary to NSArray containing keys and values -


i don't know if there easy way implement this, or need implemente algorithm myself.

this have (nsdictionary):

 {     14 =         (         "m"     );     15 =         (         "h"     );     16 =         (         "f",         "g"     ); 

and want (nsarray):

     {         14,         "m",         15,         "h" ... } 

im looking easy way, in case need algorithm i'll myself

you iterate on nsdictionaryand add keys , values this:

  nsmutablearray *array = [nsmutablearray array];     [may enumeratekeysandobjectsusingblock:^(id key, id obj, bool *stop)     {         [array addobject:key];          (int = 0; < [obj count]; i++){             [array addobject:[obj objectatindex:i]];         }     }]; 

Comments

Popular posts from this blog

java - Play! framework 2.0: How to display multiple image? -

gmail - Is there any documentation for read-only access to the Google Contacts API? -

php - Controller/JToolBar not working in Joomla 2.5 -