iphone - arc4random Quiz Crash -


I am very new to all this. I have read through forums, but unable to find an answer. I have made a simple question with 20 questions (make a txt file)

arc4random () trying to work on the code to choose the question on the random. It works, but crashes the app at different times. Can anyone give me some advice? Thank you. Here are some of my codes:

Code:

  // Next question go to int i; Int j; NSInteger Row = 0; I = 20; I & gt; 1; {J = arc4random ()% i; Question number = J + 1; If (question number == 1) {line = question number - 1; } And {line = ((question number - 1) * 6); }} // Set the question string, and set the button to the NSSTING * selected = buttons [[questionnaire item at endxax: line]; NSString * activeQuestion = [[NSString alloc] initWithFormat: @ "% @", selected]; [Answer1 setTitle: [Quiz ObjectAntEndex: Line + 1] Stat: UCentolstadt Normal]; [Answer2 setTitle: [questionnaire ObjectAntindex: Line + 2] forState: UIContolstadtAnaryal]; [Answer3 setTitle: [questionnaire ObjectAntindex: Line + 3] forState: UCentralStateAnimal]; [Answer4 setTitle: [questionnaire ObjectAntindex: Line + 4] forState: UIContolstadtAnnal]; RightAnswer = [[Quiz ObjectAutEX: Line +5] Int'lai]; // Set the question label on the active question question. Text = active question; // Start the timer for the countdown timer [[NSTimer Scheduled Timer with Time Interroll: 1.0 Target: Self Selector: @Selector (Countdown) userInfo: Zero repeats: Yes]; [Selected release]; [Active question release];   

}

Possibly gives you the Object AutoundEx Autoreleased object.

Comments