Widgets Page 66 - method arguments...(maybe)
Welcome, Guest. Please login or register.
Did you miss your activation email?
October 09, 2015, 07:54:28 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
| |-+ Errata
| | |-+ 5th printing
| | | |-+ Page 66 - method arguments...(maybe)
Pages: [1] Go Down
Author Topic: Page 66 - method arguments...(maybe) (Read 941 times)
Posts: 9

on: May 04, 2009, 04:23:15 PM

Think I found another one:

When I was reading through program example 4.6 at first I thought the multiply argument of "5" in the "main" section should have been "5.0" but then I got to the paragraph immediate following the program example and saw that it was intentional. I must admit, I was quite happy with myself for catching that one.

I did, however, notice that just above the multiply method, when the add method is called it is printed:

   [deskCalc add: 200.];

You clearly explain about how numeric arguments are automatically converted to match the type expected by the method, so I know that it works just fine, but given the way the rest of the program is printed should it not be:

   [deskCalc add: 200.0];

Is the omission of the "0" after the decimal intentional? If so, is there a reason?

Not sure if this one is an error or not, but thought I would mention it.


P.S. I feel like I sound really critical pointing out little typos, and I would hate to offend, or give the impression that I am anything other than completely in awe of your book. I figure you would want to know to make corrections to any further editions that may come out down the line. No? Should I keep pointing any typos if I find them or is it just adding tedious work for you in the form of more posts to read through?
Hero Member
Posts: 3114

Reply #1 on: May 04, 2009, 04:59:44 PM


For readability, you're right the 0 should be there.  However, realize that the number 200. is a floating point number.  The decimal point makes it a floating point constant.


Steve Kochan
Pages: [1] Go Up
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 All rights reserved.