Errata

Learning iOS Programming

Errata for Learning iOS Programming

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 35
United States

In the application delegate sample code, the following lines:

@property (nonatomic, retain) UIWindow *window;
@property (nonatomic, retain) ViewController *viewController;

should read:

@property (nonatomic, strong) UIWindow *window;
@property (nonatomic, strong) ViewController *viewController;

The code was supposed to have been generated by an ARC project, per the instructions on page 29, and so the properties should be marked as "strong" rather than "retain".

Philip Dow  Jul 18, 2012 
PDF Page 38
Second paragraph

The book talks about ViewController.h and ViewController.m files which do not exist as built by xcode 4.5.2. There are MasterViewController and DetailViewController files. If the steps in the book are performed on the DetailViewController files, the DetailViewController.m code will not compile as it will not recognize the 'label' object though it is defined in the associated header file.
If I simply load the HelloWorld example project, it compiles and runs fine.

My question is am I going to keep running into this incompatibility as I proceed through the book or is there a way to avoid it. From the learning standpoint, I much prefer entering the code myself rather than just compiling and running the example code.

Thanks,

Max  Dec 29, 2012 
Printed Page 70
source code

using Xcode 4.3.2.build 4e2002 on OSX 10.7.3

page 70 indicates xCode will automatically build numerous methods. In fact most of the methods shown are NOT built. This is the source which is auto-generated:


#import "CGViewController.h"

@interface CGViewController ()

@end

@implementation CGViewController
@synthesize tableview;

- (void)viewDidLoad
{
[super viewDidLoad];
// Do any additional setup after loading the view, typically from a nib.
}

- (void)viewDidUnload
{
[self setTableview:nil];
[super viewDidUnload];
// Release any retained subviews of the main view.
}

- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
{
return (interfaceOrientation != UIInterfaceOrientationPortraitUpsideDown);
}

@end


viewWillAppear, viewDidAppear, viewWillDisappear, and viewDidDisappear are not automatically built as indicated...

malcolm stanley  May 20, 2012 
PDF Page 78
1st paragraph

@interface CityGuideDelegate : NSObject <UIApplicationDelegate>

should be:

@interface CGAppDelegate : NSObject <UIApplicationDelegate>

Maurice Kaag  Jul 12, 2012 
Printed Page 78, 85
1st paragraph

page 78 tableview tutorial under Adding Cities To The Guide:

CGAppDelegate.h file should look very much like the code below...

@interface CityGuideDelegate : NSObject <UIApplicationDelegate>

page 85, 3rd paragraph following on in the tutorial and referring back to the same CGAppDelegate.h file, the class name and super class name are now totally different.

@interface CGAppDelegate : UIResponder <UIApplicationDelegate>


page 78 contains the incorrect class and superclass names indicated by the implementation file (CGAppDelegate.m) yelling back bad in Xcode if used.

axilnelson  Dec 05, 2012 
PDF Page 84
1st paragraph

Go back to RootController.m / Go back to CGViewController.m

Maurice Kaag  Jul 12, 2012 
PDF, Other Digital Version Page 84
1st Paragraph

Go back to RootController.m and add the highlighted lines in the following code to the didSelectRowAtIndexPath: method:

RootController.m does not exist in the project, the reference should be to CGViewController.m, so the sentence should read:-

Go back to CGViewController.m and add the highlighted lines in the following code to the didSelectRowAtIndexPath: method:

Chris Millard  Jul 22, 2012 
Printed Page 84
1st paragraph

Chapter 5: Table View - Based Applications, Tutorial, page 84, printed, para 1, 3rd line, new sentence: "Go back to RootController.m" - reference to a non existant file in the project up to that point.

axel nelson  Dec 04, 2012 
PDF Page 96
2nd code block

it appears some old code has been copied along even though it was changed earlier in the book.

initWithFrame:CGRectZero reuseIdentifier:@"cell"] autorelease];

initWithFrame has been deprecated from iOS along with the RectZero shape/style

autorelease cannot be called directly (in iOS5)

this prevents the project from running without issues, and building successfully.

it was presented correctly earlier in the chapter as (page 83 PDF)

initWithStyle:UITableViewCellStyleDefault reuseIdentifier:@"cell"];

which leads me to believe this was a holdover from previous editions, and the changes on page 96 did not directly involve the deprecated code. Kind of confusing.

Ben Lampert  Jun 23, 2012 
PDF Page 96
if statement starting on second line

if( nil == cell ) {
cell = [[[UITableViewCell alloc]
initWithFrame:CGRectZero reuseIdentifier:@"cell"] autorelease]; }

Is inconsistent with previously typed code.
The function stated in this line has been deprecated and autorelease causes an error.

The correct function should be:

if( nil == cell ) {
cell = [[UITableViewCell alloc]
initWithStyle:UITableViewCellStyleDefault reuseIdentifier:@"cell"];
}

Anonymous  Jul 07, 2012 
PDF Page 96
Block of code

Why suddenly use 'autorelease' in the initWithFrame:CGRectZero?

Maurice Kaag  Jul 12, 2012 
PDF Page 96
1st block of code

initWithStyle:UITableViewCellStyleDefault...

suddenly becomes:

initWithFrame:CGRectZero...

did I miss anything there?

Maurice Kaag  Jul 12, 2012 
PDF Page 96
1st block of code

initWithStyle:UITableViewCellStyleDefault...

suddenly becomes:

initWithFrame:CGRectZero...

did I miss anything there?

Maurice Kaag  Jul 12, 2012 
PDF Page 96
2nd code block

On two of these lines, `tableView` must be replaced with `self.tableView` in order for the project to compile and run.

Thomas Baldwin  Sep 12, 2013 
PDF Page 110
2nd block of code

#import "City.h";

should be:

#import "City.h"

without the ;

Maurice Kaag  Jul 12, 2012 
PDF Page 124
last paragraph

Add the following to MainViewController.m

should be:

Add the following to BMMainViewController.m:

Maurice Kaag  Jul 12, 2012 
PDF Page 143
numberOfRowsInSection

According to point 3 (page 142), the if( self.editing ) { ... } conditional statement in the tableView:numberOfRowsInSection: method should be removed. However page 143, the statement is still presented as the final code.

Maurice Kaag  Jul 12, 2012 
Printed Page 143
if (indexPaht.row < cities.count)

Previous page tells the reader to delete the line:

"cell.editingAccessoryType = UITableViewCellAccessoryNone;"

but subsequently told that the results should be the same as this, where the line is still present.

John Sim  Aug 10, 2012 
Printed Page 143
-(NSInteger) tableView:(UITableView *)tv numberOfRowsInSection:(NSInteger)section

Previous page tells the reader to delete the section:

"if(self.editing) {
count = count + 1;
}"

And then to verify the file with this page, but this line is still present in the listing given.

John Sim  Aug 10, 2012 
ePub Page 152
4

- (void)tableView:(UITableView *)tvdidSelectRowAtIndexPath:(NSIndexPath *)indexPath

has a space missing, and should read:

- (void)tableView:(UITableView *)tv didSelectRowAtIndexPath:(NSIndexPath *)indexPath

Wayne Smallman  Apr 21, 2013 
PDF Page 193
4th paragraph

PrototypeViewController.h does not exist, it should be ViewController.h

Maurice Kaag  Jul 13, 2012 
Printed Page 200
Google Weather Service Section

Google have seemingly just today cancelled the weather service API that this program uses. It will therefore not run.

John Sim  Aug 28, 2012 
ePub Page 204
3

While it appears that this might be candidate for a serious technical mistake, I need to be sure it's not an over sight on my part.

Previously, the code was:

cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:@"cell"];

but later in becomes:

cell = [[[UITableViewCell alloc] initWithFrame:CGRectZero reuseIdentifier:@"cell"] autorelease];

which generates a number of warnings and errors in Xcode, none of which I know how to rectify, other than reverting to the previous code.

However, what is known here is if I use the code as specified after page 204, the application won't compile.

Wayne Smallman  Apr 21, 2013 
PDF Page 212
Using the XPath Wrappers

Compiling with that implementation of XPath will failed with the following error:

Undefined symbols for architecture i386:
"_PerformXMLXPathQuery", referenced from:
-[WeatherForecast connectionDidFinishLoading:] in WeatherForecast.o
ld: symbol(s) not found for architecture i386
clang: error: linker command failed with exit code 1 (use -v to see invocation)

In order to fix this issue, you have to reference the file XPathQuery.m in the Compiled Sources (Target / Build Phases).

Maurice Kaag  Jul 13, 2012 
ePub Page 234
3

Again, initialisation of UITableViewCell is different:

cell = [[UITableViewCell alloc] initWithFrame:CGRectZero reuseIdentifier:@"cell"];

where (at least in earlier mentions) it is:

cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:@"cell"];

As you can imagine, such apparent inconsistencies are making the learning process not just difficult but dauntingly complex and frustrating.

I suspect these inconsistencies are the reason why that after clicking the "Edit" button and then clicking "Done" the application instantaneously crashes, irrespective of which line of code I use.

Yet, if I return to earlier iterations of code before this line was used, the application works fine, albeit without the edit functionality.

Wayne Smallman  Apr 21, 2013 
Printed Page 248
first "trap" commentary

the code "gcc -o eatblob eatblob.c -lsqlite3" should be "gcc -o eat blob eatblob.c getdelim.c getline.c -lsqlite3"

Richard Stone  Jul 21, 2012 
Printed Page 264
first "tracks" block

the roll control of an aircraft is done by moving the ailerons. The flaps are used to change lift and drag at a given airspeed.

Richard Stone  Jul 23, 2012 
Printed Page 264
first "track" block

The "tail flap" is called the rudder. It does induce yaw. The heading of the aircraft is actually changed by banking to the right or left, then applying rudder yaw to push the tail around to follow a circular path.

Richard Stone  Jul 23, 2012 
Printed Page 286
top of page sidebar


Current text :

However, if you keep the nose straight ahead, you can also modify the roll of the aircraft using the flaps; one wing will come up, the other will go down. Finally keeping the wings level, you can use the tail flap to change the heading (or yaw) of the aircraft (rotating it in a 2D plant).

Should read :

However, if you keep the nose straight ahead, you can also modify the roll of the aircraft using the ailerons; one wing will come up, the other will go down. Finally keeping the wings level, you can use the rudder to change the heading (or yaw) of the aircraft (rotating it in a 2D plant).

Note :

Flaps are not used to change the direction of flight of an aircraft. They enable the aircraft to fly more slowly during takeoff and landing. There are no flaps on the tail, only a rudder for yaw and an elevator to change pitch.

Crispin Read  Sep 18, 2013 
PDF Page 495

XCode version 4.3.2
IOS 5.1
Following the code in the Master-Detail chapter, and it is all different. I completed Chapter 5 with no errors. What do I need to do in order to make XCode create the code in your book?
Thanks, and well done.
Harry

Harold A Mackey  May 22, 2012 
ePub Page 2868
location 2868 of 12687 (kindle)

You seem to have switched


cell = [[ UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:@" cell"];

to

cell = [[[ UITableViewCell alloc] initWithFrame:CGRectZero reuseIdentifier:@" cell"] autorelease];

part way through the code excerpts in the book, but not here:

http://examples.oreilly.com/0636920018490/LearningiOSProgramming2ndEd_Examples/CityGuide4/CityGuide/CGViewController.m

something the snuck in from an older version?

Anonymous  Nov 21, 2012