Amazon.com Widgets Ch. 15, Program 15.11 AddressBook.m Implementation Fie.
Welcome, Guest. Please login or register.
Did you miss your activation email?
October 30, 2014, 09:39:31 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
| | | |-+ Ch. 15, Program 15.11 AddressBook.m Implementation Fie.
Pages: [1] Go Down
Print
Author Topic: Ch. 15, Program 15.11 AddressBook.m Implementation Fie. (Read 1144 times)
ria45
Newbie
*
Posts: 11


Email




on: July 15, 2009, 11:18:44 PM

Hello!
On page 348 the book says ,
 " ...You defined  initWithName: to return an id object, instead of  an AddressBook one. If AddressBook is subclassed, the  argument to  initWithName: isn't  an AddressBook object; its type is that of the subclass.
For that reason, you define the return type as a generic object type.."

Why do you say the  argument to  initWithName: isn't  an AddressBook object? The  real argument
is  (NSString*) name, no?
Thank you.

Logged
skochan
Administrator
Hero Member
*****
Posts: 3114







Reply #1 on: July 16, 2009, 01:18:58 AM

I believe you're referring to the statement on page 354 and not 348?   You're right, the sentence should read

If AddressBook is subclassed, the  receiver of the initWithName: message (and therefore the return value) isn't  an AddressBook object; its type is that of the subclass.

Cheers,

Steve Kochan
Last Edit: July 16, 2009, 01:50:11 AM by skochan 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.