1
I have a Dictionary as image below and would like to play Dictionary medicines keys names for an array, as I can perform so function
1
I have a Dictionary as image below and would like to play Dictionary medicines keys names for an array, as I can perform so function
3
Nsdictionary has the method - (NSArray *)allKeys
which returns an array containing all the keys of the dictionary
It is good to remember that the order of the keys in the vector returned by -[NSDictionary allKeys]
is undefined. In particular, there is no guarantee that the order is equal in separate executions even if the dictionary contains the same key-value pairs.
0
NSString * path= [[NSBundle mainBundle]pathForResource:@"Medicamentos" ofType:@"plist"];
NSDictionary * dadosArquivo =[NSDictionary dictionaryWithContentsOfFile:path];
NSArray * medicamentos =[dadosArquivo objectForKey:@"medicamentos"]; //
NSLog(@"%@", medicamentos);
I guess that’s it.
Browser other questions tagged ios objective-c
You are not signed in. Login or sign up in order to post.
Why
medicamentos
is a dictionary instead of a vector?– user7835