Amazon.com Widgets program 21.2 question
Welcome, Guest. Please login or register.
Did you miss your activation email?
September 23, 2014, 09:22:19 AM
Home Help Search chat Login Register 
News: Read this please.The Great Kangaroo Escape Looking for reviews of the 4th ed on Amazon!   Twitter:  @skochan
                     

+ Official Forum for Programming in Objective-C (the iPhone Programming Language) - Stephen Kochan
|-+ Old Stuff
| |-+ Chapter Study
| | |-+ Chapter 21 - Writing iPhone Applications
| | | |-+ program 21.2 question
Pages: [1] Go Down
Print
Author Topic: program 21.2 question (Read 1197 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:



Login with username, password and session length

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 (c) 2009 classroomM.com. All rights reserved.