I have an array of dictionary with only one entry in the dictionary.
___ ___________
|___| --->|__|__|__|__| Array of Dictionary
|___| __|__
|___| |K|V| Dictionary
|___|
Array of Array
My dictionary content is <NSString*, UIImage*>
How to retrieve the values of my dictionary.
Code Snippet:
for (int i=0 ; i< [imagesToFill count]; i++) {
NSDictionary* dict = [imagesToFill objectAtIndex:i];
UIImage* img = ??? [dict] // How to retrive value from above dict which has only 1 entry
NSString* imgPath = ???
}
Note: Each dict has <NSString*, UIImage*>
you can get all keys of a dictionary like that:
and of course the same is true for all values:
And then simply use
objectAtIndex:0(orlastObject) to access your key or value.The order of both arrays is not defined (i.e. random). This won’t be a problem in your case. But keep that in mind.