Declarations
To manage its relationships and responsibilities, the QuizViewController object needs five instance variables and two methods. In this section, you will declare these in the QuizViewController header file, QuizViewController.h.
Declaring instance variables
Here are the five instance variables QuizViewController needs:
- questions
a pointer to an NSMutableArray containing instances of NSString
- answers
a pointer to another NSMutableArray containing instances of NSString
- currentQuestionIndex
an int that holds the index of the current question in the questions array
- questionField
a pointer to the UILabel object where the current question will be displayed
- answerField
a pointer to the UILabel object where the current answer will be displayed
In ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access