iOS Apprentice v5.0 Minor Mistake in Tutorial 1

Hi,

I was working on Tutorial 1: BullsEye App, and on Page 89, it says that:

In showAlert(), there are six locals and you use three instance variables:

And then on the next page it says that there are four of them.

The instance variables, on the other hand, are defined outside of any method. It is common to put them at the top of the file:

class ViewController: UIViewController { 
  var currentValue = 0
  var targetValue = 0
  var score = 0
  var round = 0

Is it just a typo or am I missing something here?

I have uploaded the screenshot. Please take a look.

HERE IS THE SCREENSHOT:

I can see the confusion, but technically the text is correct: in the showAlert() function, there are six local variables and you use three instance variables. There are more than three instance variables in the object, but you only use three of them in the function (round isn’t used in showAlert()).

1 Like

@narrativium Yeah, you are right. I just got confused by the text there.
Thanks for clearing the confusion.