I have created a quiz application. I want to generate a random question. The questions come from Core Data. When view didAppear is called I store the question in an array and display it by a display question method. But i want to display the questions randomly without repeating any question, and every question will display. How can I do this ?
Share
You should copy your questions in an tmp array and each time a question is randomly picked by a random function (eg :
int r = arc4random() % [myArray count];) you delete its entrance from the tmp array.