Official Forum for Programming in Objective-C (the iPhone Programming Language) - Stephen Kochan
August 16, 2017, 08:33:22 AM *
Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
 
   Home   Help Search Login Register Chat  
Pages: [1]   Go Down
  Print  
Author Topic: program 21.2 question  (Read 1752 times)
tamayop
Newbie
*
Posts: 4


Email
« on: May 17, 2010, 02:21:07 PM »

I am wondering, in which part of the program the variable currentNumber gets initialized to 0 before any digit is pressed.  Since currentNumber = currentNumber * 10 + digit, then I guess that a the beginning it just need to be 0.

Thanks for a great book!
Logged
skochan
Administrator
Hero Member
*****
Posts: 3114



« Reply #1 on: May 17, 2010, 02:45:24 PM »

That's an oversight!   It works because. since it's an instance variable, its value will be set to zero when the view controller object gets initialized.   It should be initialized with the other variables in the viewDidLoad method.

Cheers,

Steve
Logged
tamayop
Newbie
*
Posts: 4


Email
« Reply #2 on: May 17, 2010, 03:23:46 PM »

Thank you.  Puzzle solved.
Logged
Pages: [1]   Go Up
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.11 | SMF © 2006-2009, Simple Machines LLC Valid XHTML 1.0! Valid CSS!
Entire forum contents ゥ 2009 classroomM.com. All rights reserved.