Declarations

To manage its relationships and responsibilities, QuizAppDelegate needs five instance variables and two methods. In this section, you will declare these in the QuizAppDelegate header file, QuizAppDelegate.h.

Declaring instance variables

Here are the five instance variables QuizAppDelegate 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 the project navigator, ...

Get iOS Programming: The Big Nerd Ranch Guide, Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.