I have an array of dictionaries stored in a plist with keys and strings, they are questions and answers for my Quiz app. I am putting a random question on screen but I want to put the answers of the question in a random order also on screen. How can I do that?
This is how the questions are referenced:
-(void)displayQuestion: (NSDictionary *) Question
{
[questionLabel setText:[Question objectForKey:@"Question"]];
[answer1 setText:[Question objectForKey:@"Answer1"]];
[answer2 setText:[Question objectForKey:@"Answer2"]];
[answer3 setText:[Question objectForKey:@"Answer3"]];
}
<dict>
<key>category</key>
<string>Elementary Pilot</string>
<key>Question</key>
<string>You are approaching a hang glider head-on and at approximately the same height. You should:</string>
<key>Answer1</key>
<string>Turn to your right?</string>
<key>Answer2</key>
<string>Turn to your left?</string>
<key>Answer3</key>
<string>Lose height rapidly?</string>
</dict>