Creating Model Objects

View objects make up the user interface, so developers typically create, configure, and connect view objects using Interface Builder. Model objects, on the other hand, are set up in code.

In the project navigator, select BNRQuizViewController.m. Add the following code that declares an integer and pointers to two arrays.

@​i​n​t​e​r​f​a​c​e​ ​B​N​R​Q​u​i​z​V​i​e​w​C​o​n​t​r​o​l​l​e​r​ ​(​)​

@​p​r​o​p​e​r​t​y​ ​(​n​o​n​a​t​o​m​i​c​)​ ​i​n​t​ ​c​u​r​r​e​n​t​Q​u​e​s​t​i​o​n​I​n​d​e​x​;​

@​p​r​o​p​e​r​t​y​ ​(​n​o​n​a​t​o​m​i​c​,​ ​c​o​p​y​)​ ​N​S​A​r​r​a​y​ ​*​q​u​e​s​t​i​o​n​s​;​
@​p​r​o​p​e​r​t​y​ ​(​n​o​n​a​t​o​m​i​c​,​ ​c​o​p​y​)​ ​N​S​A​r​r​a​y​ ​*​a​n​s​w​e​r​s​;​
 @​p​r​o​p​e​r​t​y​ ​(​n​o​n​a​t​o​m​i​c​,​ ...

Get iOS Programming: The Big Nerd Ranch Guide now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.