|
||
ErrataWe welcome comments and corrections to this title. Cocoa Programming has had the benefit of review by three authors, two technical reviewers, and five editors using an extensive formal review process. Nevertheless, we are sure that mistakes have been made and improvements are possible. Please feel free to send suggestions and corrections to comments@cocoaprogramming.net. We will incorporate reader feedback as much as possible in future editions. One of the pleasures of developing software with Cocoa has always been the community surrounding the technology, and one reason we wrote this book was to contribute to that community. With your help, we can produce an even better book in the future. Current ErrataCode Examples in the bookIn every code example, the C post decrement operator -- has been replaced with an [em] dash in printed source code. The page layout software used by the publisher probably did this and nobody noticed. For example: See page 1127
- (void)dealloc
/*" Clean-up "*/
{
_MYTotalNumberOfInstances-;
[super dealloc];
}
@end
which should be
- (void)dealloc
/*" Clean-up "*/
{
_MYTotalNumberOfInstances--;
[super dealloc];
}
@end
The downloaded code examples are correct. Chapter 4- Objective-CPage 69Paragraph 3 "The syntax for sending a distributed message is exactly the same as the stntax for local messages." it should read "The syntax for sending a distributed message is exactly the same as the syntax for local messages." Page 77In the example code on page 77, the method name -avarageValue; should be -averageValue;
Page 78The first sentence is ..."values is returned from the -average method." it should be ..."values is returned from the -averageValue method." Page 78In the example code on page 78, the method name -(float)avarageValue; should be -(float)averageValue;
Page 78The implementation of -setValue:atIndex: is -(void)setValue:(float)aValue atIndex:(int)anIndex
{
// set the value with the specified index
if (anIndex>= 0 && anIndex<10) {
_myValueArray[i]=aValue;
}
}
it should be -(void)setValue:(float)aValue atIndex:(int)anIndex
{
// set the value with the specified index
if (anIndex>= 0 && anIndex<10) {
_myValueArray[anIndex]=aValue;
}
}
Chapter 5 - ConventionsPage 117In the second code example, the method name retain has been mislabeled as reatin. The corrected source is listed below. - (id)initWithCoder:(NSCoder *)coder
{
self = [super init];
_myLabel = [[coder decodeObject] retain];
_myLabelFont = [[coder decodeObject] retain];
[coder decodeValueOfObjCType:@encode(NSPoint)
at:&_myLabelPosition];
_myExtraData = [[coder decodeObject] retain];
[coder decodeValueOfObjCType:@encode(float)
at:&_myLineWidth];
_myStyles = [[coder decodeObject] retain];
_myColor = [[coder decodeObject] retain];
return self;
}
Chapter 7- Foundation Framework OverviewPage 150The implementation of MYSimpleClass is incorrect. The following code is corrected. @interface MYSimpleClass
{
NSMutableString *_myStringValue;
}
- (NSString *)safeStringValue1;
- (NSMutableString *)safeStringValue2;
}
@implementation MYSimpleClass
- (NSString *)safeStringValue1
{
// The instance variable can be safely returned.
// The caller will have to cast the return value
// to violate MYSimpleClass’s encapsulation
return _myStringValue;
}
- (NSMutableString *)safeStringValue2
{
// A mutable copy of the instance variable is returned
return [[_myStringValue mutableCopy] autorelease];
}
@end
Chapter 9 - Applications, Windows and ScreensPage 235-236The implementation of _mySetDocumentPath: reads the following (top of page 236) _myDocumentPath = aPath; it should in fact read _myDocumentPath = standardPath;
This has been corrected in the example code available for download. Chapter 16 - MenusPage 634The first paragraph, second sentence reads "The dictionary contains a single key, @"NSMenuItem", which returns the NSMenuItem that has been selected." it should read "The dictionary contains a single key, @"MenuItem", which returns the NSMenuItem that has been selected." Chapter 20 - Apple HelpPage 793-794 It is not necessary to change the file type and creator before indexing help files as is stated on these pages. Chapter 25 - PrintingPage 954 Figure 25-7 shows the incorrect images for Pages 2 and 4. A corrected PDF of the image is available. Page 957 Figure 25-8 shows the incorrect images for Pages 2 and 4. A corrected PDF of the image is available. Chapter 26 - Application Requirements, Design and DocumentationPage 969The figure is incorrectly cropped. The caption says "TransparentTetris
is implemented with the two windows shown." Only one of the windows
is shown
Appendix A - Unleashing the Objective-C RuntimePage 1075In the Common Runtime Functions section, the first piece of example code is incorrect, it reads NSLog(@"%@",NSStringForSelector(_cmd)); instead, it should read NSLog(@"%@",NSStringFromSelector(_cmd));
|
||
| Copyright 2002 - Scott Anguish, all rights reserved. |