Here are the known errata for the book. Each item is notated affecting either the eBooks, the printed books, or both.
Page 62: (print only)
missing import:
#import <stdio.h>
#import <readline/readline.h> // missing this import
int main(int argc, const char * argv[])
{
printf("Who is cool? ");
const char *name = readline(NULL);
printf("%s is cool!\n\n",name);
return 0;
}
Page 74: (print/ebook)
metersToFeedAndInches() should be metersToFeetAndInches().
Page 107:
NSString listOfNames = @"..."; // a long list of names
NSString name = @"Ward";
NSRange match = [listOfNames rangeOfString:name];
should be
NSString *listOfNames = @"..."; // a long list of names
NSString *name = @"Ward";
NSRange match = [listOfNames rangeOfString:name];
(asterisks were missing)
Page 121: (print/ebook)
âTo find out what the count method does, you should go to NSDateâs class reference page.â Should refer to âNSArrayâs class reference page.â
Page 148: (print/ebook)
âThis challenge builds on the challenge from the previous chapter.â Actually, it builds on the challenge from chapter 18, two chapters ago.
Page 181: (print/ebook)
should be
Page 202: (print/ebook)
âo You can also create an instance ofâŠâ Spurious âoâ at the beginning.
Page 211-212: (print only)
incomingData, being an instance variable, should be underscored throughout this exercise (to appear as _incomingData). For bonus points, it should be declared and accessed as a property rather than an instance variable.
Page 286: (print only)
wrong method names:
[code]@interface BNROwnedAppliance : BNRAppliance
@property (readonly) NSSet *ownerNames;
- (instancetype)initWithProductName:(NSString *)pn
firstOwnerName:(NSString *)n; - (void)addOwnerNamesObject:(NSString *)n; // should be addOwnerName:
- (void)removeOwnerNamesObject:(NSString *)n; // should be removeOwnerName:
@end[/code]
Page 287: (print only)
missing @end:
@interface BNROwnedAppliance ()
{
NSMutableSet *_ownerNames;
}
@end // this was missing
Page 295: (print only)
missing Mushroom* in property and too many colons in setter name:
[code]@interface Badger : NSObject ()
@property (nonatomic) mushroom; // Should be â@property (nonatomic) Mushroom *mushroom;â
@end
@implementation Badger;
@synthesize mushroom = _mushroom;
-
(Mushroom *)mushroom
{
return _mushroom;
} -
(void)setMushroom::(Mushroom *)mush // too many colons
{
_mushroom = mush;
}[/code]