Designing Quiz

You are going to write the Quiz application using the MVC pattern. Here is a break down of the objects you will be creating and working with:

  • 4 view objects: two instances of UILabel and two instances of UIButton

  • 2 controller objects: an instance of BNRAppDelegate and an instance of BNRQuizViewController

  • 2 model objects: two instances of NSMutableArray

These objects and their relationships are laid out in the object diagram for Quiz shown in Figure 1.7.

Figure 1.7  Object diagram for Quiz

Object diagram for Quiz

This diagram is the big picture of how the finished Quiz application will work. For example, when the Show Question button is tapped, it will trigger a method in the BNRQuizViewController. A method is a lot like a function – a list of instructions to be executed. This method will retrieve a new question from the array of questions and ask the top label to display that question.

It is okay if this object diagram does not make sense yet; it will by the end of the chapter. Refer back to it as you continue to see how the app is taking shape.

You are going to build Quiz in steps, starting with the controller object that sits in the middle of the app – BNRQuizViewController.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset