Sams Teach Yourself Cocoa Touch Programming in 24 Hours book

(Author: Sengan Baring-Gould, Sams, 9780672331251 / 067233125X, pub date 10/15/2009):

(b) Critical errors

The following errors will hurt the readers' comprehension

(c) Page 41

Replace "the following line in dealloc" by "the following line called from dealloc"

(c) Page 53

Replace "Using the notation" by "Using the \uXXXX notation". Replace "You cannot use the notation" by "You cannot use the \uXXXX notation"

(c) Page 86

Unfortunately the following subsection was moved to Appendix D, but it should have been left on page 86.

(d) Testing String Mutability with Exceptions

We can test a string's mutability as follows. Again don't use this for production code.

BOOLisMutableString(NSString* string)

{

@try

{ [((id) string) setString:string];

returnYES; }

@catch(ide) {}

returnNO;

}

(Casting string to id removes a static type check warning.)

(c) Page 115

Before "The following getter methods are tried in order", the following sentence is missing:

"NSObject's setValue:forKey: and valueForKey: methods provide Objective-C's keyvaluefunctionality."

(c) Page 119

"Each IMP Key-Value Observation invokes its superclass" should say "Each IMP Key-Value Observation adds invokes its superclass"

(c) Page 479

Replace the first occurrence of the following line

#include <mach/mach.h>

by

#include <mach/mach_time.h

(b) Errors

(c) Page 55

Replace "of descriptionU" by "of description"

(c) Page 65

Replace "by the objc_msgSendfunction" by "by the objc_msgSend function".

(c) Page 67

The following line of code:

returnfunction(arguments);

Should be:

returnfunction(receiver, name, arguments...);

(c) Page 83

Somehow the code was mislaid out:

history = [[NSMutableStringalloc] initWithCapacity:4096];

[historyrelease]; history = nil; // history has no setter

- (void) updateScreen:(float)value;

{ textView.text = [NSStringstringWithFormat:@"%@%g", history, value]; }

(There are spaces missing between NSMutableString and alloc, and between NSString and stringWithFormat)

(c) Page 114

In the @interface declaration, the method name should start with toySetValue: rather than setValue:

(c) Page 151

Replace "Threads might not" by "Threads may not"

(c) Page 207

w = 1-z/Z isaseparateequationandshouldbeplacedafterthepreviousequation

- page 284: In figure 12.4b, the box with the x in it should be a curved line (almost like an n).

(c) Page 382

Replace "sqlite3_close(*db);" by "sqlite3_close(db);"

(b) Rephrase for clarity in the second edition

(c) Page 30

Replace "super also points to the method's object" by "super points to the same object as self"

(c) Page 39

Replace "The dealloc method closes any files the object owns and releases any objects it owns" by "The dealloc method should close any files the object owns and release any objects it owns"

(c) Page 66

Replace "The s2s type helps" by "The s2s type coercion helps"

(c) Page 73

Replace "To do this, add the following to @implementation" by "To do this, add the following to the @implementation block"

(c) Page 74

Replace "If I request accessors to be @synthesize" by "If I request accessors to be @synthesized"

(c) Page 133

Replace "invoking layoutIfNeeded on each" by "invoking layoutIfNeeded on each view".

(c) Page 135

Replace "when one or more fingers touch down on the screen" by "when one or more fingers touch the screen".