1 2 3 4 5 6 7 8 9 10
| //1.当前答题的索引,索引递增 self.index++; //2.从数组中按照索引取出题目模型数据 Question *question=self.questions[self.index]; //3.设置基本信息 self.noLabel.text=[NSString stringWithFormat:@"%d/%d",self.index+1,self.questions.count]; self.titleLabel.text=question.title; [self.iconButton setImage:[UIImage imageNamed:question.icon] forState:UIControlStateNormal]; //如果达到最后一题,禁用下一题按钮 self.nextQuestButton.enabled=(self.index<self.questions.count-1);
|