Errata

Cocoa in a Nutshell

Errata for Cocoa in a Nutshell

Submit your own errata for this product.

The errata list is a list of errors and their corrections that were found after the product was released.

The following errata were submitted by our customers and have not yet been approved or disproved by the author or editor. They solely represent the opinion of the customer.

Color Key: Serious technical mistake Minor technical mistake Language or formatting error Typo Question Note Update

Version Location Description Submitted by Date submitted
Printed Page xvii
7th paragraph

The paragraph starts with "mmalcolm Crawford ... ". That should probably be "Malcolm ...".

Anonymous  Apr 28, 2018 
Printed Page 11
5th line from bottom

Song song = [song alloc];
should be the following instead
Song song = [Song alloc];

Anonymous   
Printed Page 12
top of page

Song song = [[song alloc] init];
should be
Song song = [[Song alloc] init];

Anonymous   
Printed Page 14
Ex. 1.9

The code frag shows "title = [newTitle copy]";
shouldn't that be "title = [aTitle copy]"?
At least, there ought to be some declaration for newTitle, no?

Anonymous   
Printed Page 19
11th paragraph

There is a line of code that looks like this:

char cStr = [str UTFString];

when it should be:

char *cStr = [str UTF8String];

The pointer was forgotten, and the method is UTF8String, not UTFString.

Anonymous   
Printed Page 24
middle paragraph

NString should be NSString.

Anonymous   
Printed Page 26
2nd paragraph

In the beginning of the example some NSNumber's are instantiated with names
cN,lN,usN. Later the variable names are backwards and loose the capitalization on the N.

The line BOOL b = [nc isEqualToNumber:nl];
should be BOOL b = [cN isEqualToNumber:lN];

Likewise the line NSComparisonResult r = [nc compare:nus];
should be NSComparisonResult r = [cN compare:usN];

also
r = [nus compare:ns];
should be r = [usN compare:cN]; //not sure if cN is what you want here, my guess is yes

Anonymous   
Printed Page 29
Example 2-11, 8th 'paragraph'

set1 is created as (a, b, c, d)
set3 is created as (c, d, e, f)

Fourth line of code is
b = [set3 intersectsSet:set1]; // Returns NO
However, these two sets do intersect, and this code returns YES (tested on Leopard)

Anonymous   
Printed Page 30
//Create a dictionary with many objects and keys

This is wrong:
d = [NSDictionary dictionaryWithObjects:@"a", @"b", nil
forKeys:@"A", @"B", nil];

Should be:
d = [NSDictionary dictionaryWithObjects: [NSArray arrayWithObjects: @"a", @"b", nil]
forKeys:[NSArray arrayWithObjects:@"A", @"B", nil]];

Anonymous   
Printed Page 50, 25

Anonymous   
Printed Page 50, 25, 75

The bottow figures in brackets might also need correcting to: (50, 25), phase = 25

Anonymous   
Printed Page 89
Figure 4-6

the description in brackets after both of the two upper dashed lines appears to be
incorrect... shouldthese not read (respectively):

Anonymous   
Printed Page 115
In example 6.1, under the comment "Other ways to create a host object"

The examples using hostWithAddress: and hostWithName: need to be switched, i.e. it
should read hostWithName:@"www.oreilly.com"

Anonymous   
Printed Page 116
Ex. 6-2

The third example showing how to initialize with scheme, host and path,
has an extra space in the string for the scheme. It should read (in
part):
initWithScheme:@"FTP"

Anonymous   
Printed Page 145
2nd line of code in example 8.6

Typo: "NSAtrributedString" should be "NSAttributedString".

Also, extra word "strin".

Anonymous   
Printed Page 325
Line 48

-(void)curveToPoint:(NSPoint)endPoint;

should be

- (void)curveToPoint:(NSPoint)endPoint
controlPoint1:(NSPoint)controlPoint1
controlPoint2:(NSPoint)controlPoint2;

Anonymous