I need to randomize an NSArray that I have loaded with quiz questions. I have read other posts about randomizing NSArray, but I need to keep the elements in a specific order.
The array format is as follows:
@"Question1",@"ans1",@"ans2",@"ans3",@"ans4",@"cor rect answer",
@"Question2",@"ans1",@"ans2",@"ans3",@"ans4",@"cor rect answer",
and so on...
I would like to shuffle the array while keeping all these sets of 6 (the question and answer choices) next to each other. Any suggestions would be greatly appreciated.
just in case i think this is easier at least for me
c/p from another forum
You can create a class as mentioned before, or you could look at using plist or dictionaries. A plist/dictionary is basically an array or arrays. Therefore you would just have to randomly pick with object("array") you want to display.