如何在游戏开始前添加显示指令的警报:
请参见下面的代码:
- (void)viewDidLoad
{
[super viewDidLoad];
if (questions && configDictionary) {
[questionLabel setText:[[questions objectAtIndex:currentQuestonIndex] objectForKey:@"question"]];
NSArray *answers = [[questions objectAtIndex:currentQuestonIndex] objectForKey:@"answers"];
[answerLabel0 setText:[answers objectAtIndex:0]];
[answerLabel1 setText:[answers objectAtIndex:1]];
[answerLabel2 setText:[answers objectAtIndex:2]];
[answerLabel3 setText:[answers objectAtIndex:3]];
[pointsPerAnswerLabel setText:[NSString stringWithFormat:@"+%d points", [[configDictionary objectForKey:kPointsPerCorrectAnswer] intValue]]];
[currentQuestionNumberLabel setText:[NSString stringWithFormat:@"question %d", currentQuestonIndex+1]];
}
}