Errata

iPhone Open Application Development

Errata for iPhone Open Application Development

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 ...
A plus sign (+) identifies the method as a static method, while a minus sign (-) declares the method as an instance

method. Thus, the alloc method (to allocate a new object) will be called using a reference directly to the MyWidget
class, whereas methods that are specific to an instance of the MyWidget class, such as needsBatteries and powerOn, will
be invoked on the instance returned by alloc.

the method "powerOn" is an instance one (+), but "needsBatteries" is not (+)

Anonymous   
Printed Page 1
4th sentence, 3rd paragraph

The 4th sentence of the 3rd paragraph refers to the arm processor; it should be ARM processor (Advanced RISC Machines).

Anonymous   
Printed Page 18
http://safari.oreilly.com/9780596518554/integrating_with_xcode

John's original version can be found at http://www.monsterandfriends.com/?q=node/62.

the url gives a 404

Anonymous   
Printed Page 20
2.5.2, example 2.1 and 2.5.2.3

In example 2-1, we read

+ (BOOL)needsBatteries;
- (BOOL)powerOn;

and the text at paragraph 2.5.2.3 reads

Anonymous   
Printed Page 32
code example

shouldn't it be "self =" not "self ==" ?

Anonymous   
Printed Page 34
MainView initWithFrame and dealloc

The call to the parents initializer is wrong and does a comparison instead of setting self

Instead of:
if((self == [super initWithFrame...

Should be
if(self = [super initWithFrame: rect]) {

It functionally works but is incorrect and causes a warning in the official sdk compiler.

Also dealloc is implemented incorrectly and should not call [self dealloc] as it will just recall the current method
creating an infinite loop.

Anonymous   
Printed Page 46
middle of page

In the implementation of 3.7 Navigation Bars example, the following call to [self dealloc] will inherently makes the
application crash

- (void)dealloc
{
[ navBar release ];
[ navItem release ];
[ self dealloc ];
[ super dealloc ];
}

calling [self dealloc] enters the function again and RE-release navBar which crashes the application

Anonymous   
Printed Page 67
Below 2nd paragraph, make comme

Line reads: ... FileTable.m DeleteableCell.m

Should read: ... FileTable.m UIDeleteableCell.m

Anonymous   
Printed Page 67
Second paragraph

The compilation instructions for the "File Browser" example omit the necessary clause "-framework GraphicsServices". The
example won't compile as described.

Anonymous   
Printed Page 76
http://safari.oreilly.com:80/9780596518554/status_bar_manipulation

in 3.11.3.2. Displaying and removing the status bar image

code is misleading:
[ UIApp addStatusBarImageNamed: @"NAME" removeOnAbnormalExit: YES ];

because UIApp starts with an uppercase letter, it really looks like you're calling a class method whereas
addStatusBarImageNamed:removeOnAbnormalExit: is an instance method

maybe you should change the text to
[ self addStatusBarImageNamed: @"NAME" removeOnAbnormalExit: YES ];

or
[ appInstance addStatusBarImageNamed: @"NAME" removeOnAbnormalExit: YES ];

Anonymous   
Printed Page 77
http://safari.oreilly.com:80/9780596518554/application_badges

well, in fact the real solution to the UIApp "misunderstanding" is that maybe you should introduce that UIApp stands for
the shared UIApplication instance

you could do it in the UIKit introductiond and remind it when it is used for the first time in the status bar
manipulations chapter

Anonymous   
Printed Page 90
Example 4-1 and 4-2

I am reading the Safari Books Online version of this book.

All instances of

(struct _ _GSEvent *)event;

cause a compiler error and should be changed to

(struct _GSEvent *)event;

Anonymous   
Printed Page 153
http://safari.oreilly.com:80/9780596518554/advanced_uikit_design

instead of suggesting using mouseDown/mouseUp, you should mention UISegmentedControl's delegate methods:

segmentedControl:selectedSegmentChanged:
segmentedControlDisclosureButtonClicked:

everywhere in general Cocoa programming books/tutorials delegates are preferred over subclassing

Anonymous   
Printed Page 157
Preferences Table section

the section fails to detail

- (int)preferencesTable:(UIPreferencesTable *)aTable
numberOfRowsInGroup:(int)group;

as part of the data source delegates.

Anonymous   
Printed Page 191
http://safari.oreilly.com/9780596518554/section_lists

- (UITableCell *) table: (UITable *)table cellForRow:
(int)row column:
(int)col
reusing: (BOOL) reusing
{
return [ files objectAtIndex: row ];
}

although the book text doesn't mention this data source explicitly, it is illustrated in the companion example, however
the signature is wrong.

the "reusing" parameter is an id, which corresponds to a previous cell the table is going to recycle.

cell recycling is enabled by invoking setReusesTableCells:YES on a table

Anonymous