I have successfully populated a UIPickerView with the contents of a plist.
Here is the example of the list:
I have done this with:
Now I am having issue in segueing this plist to to a Details ViewController. I am not sure how to capture each state in the above plist example for the selected state. Does anyone have an idea how to tackle that?
Here is the example of the list:
Code:
<dict>
<key>States</key>
<array>
<dict>
<key>StateName</key>
<string>Alabama</string>
<key>Est</key>
<string>1819</string>
<key>Cap</key>
<string>Montgomery</string>
<key>Pop</key>
<string>4822023</string>
<key>Large</key>
<string>Birmingham</string>
<key>Flag</key>
<string>Alabama.jpg</string>
</dict>
I have done this with:
Code:
NSString *StatePath = [[NSBundle mainBundle] pathForResource:@"States" ofType:@"plist"];
NSDictionary *StateDictionary = [[NSDictionary alloc] initWithContentsOfFile:StatePath];
_StatesNames = StateDictionary[@"States"];
_States = [_StatesNames valueForKeyPath:@"StateName"];
Now I am having issue in segueing this plist to to a Details ViewController. I am not sure how to capture each state in the above plist example for the selected state. Does anyone have an idea how to tackle that?