Question: I have a dictionary with all employee IDs and their names in it. Now I want the user to select a name using the UIPickerView. Problem is: if I sort the values (the names) of the dictionary, how do I know which name corresponds to its ID as there could be identical names in the dictionary.

e.g.

```
{"0001", "John Doe"}
{"0002", "John Doe"}
{"0003", "Jane Doe"}
{"0004", "Jane Alpha"}
{"0005", "Jane Doe"}

```

So if I sort the resulting array with all the values and show this in the UIPickerView and select the third row (Jane Doe), how can I then get its corresponding ID?

Answer: 
1- In case you want to sort the values of dictionary you construct your dictionary values with with unique names as if you do for key. 

2- If your are not be able to do that in case you have your simple dictionary let the user select *John Doe* out of 3.

3- If there are value duplication when showing in the picker you avoid repeating name and show it once.
You can get selected dictionary as bellow

```
NSDictionary *aDict = [yourArrayName objectAtIndex:[self.yourPickerName selectedRowInComponent:0]];
NSLog(@"%@", aDict);

```