If you have an earlier revision of the book, forward proof of purchase to [email protected] and we will provide you with a download of the latest revision in eBook format at no extra charge.
The following issues are known to be present in revision 1.2 of the book:
Chapter 8 - The Basics of Object Oriented Programming in Objective-C
In a number of instances, the account number is displayed using a %i formating directive. This should be %li. For example:Log(@"Number = %i, Balance = %f", [account1 getAccountNumber], [account1 getAccountBalance]);should read:
NSLog(@"Number = %li, Balance = %f", [account1 getAccountNumber], [account1 getAccountBalance]);
Section 32.8 Creating a Symbolic Link
The last sentence of this section states that the code creates a symbolic link from /Users/demo/file1.txt that links to the pre-existing file /tmp/myfile.txt. In actual fact the code does not reference any specific file names, leaving the choice of target and destination file names to the discretion of the reader.Section 32.9 Reading and Writing Files with NSFileManager
The following sentence:"If the file /tmp/newfile.txt in the above example had already existed it, and any data it contained, would have been overwritten by the contents of the source file."
Should read:
"If the file in the above example had already existed it, and any data it contained, would have been overwritten by the contents of the source file."
The following issues have been resolved in revision 1.2 of the book:
Chapter 6 - Testing iOS 6 Apps on the iPhone - Developer Certificates and Provisioning Profiles
Apple recently updated the interface for creating certificates, provisioning profiles and App IDs. Revision 1.2 of this book has now been fully updated to reflect these changes.Section 7.2 Objective-C Expressions
The XOR code example in this section should read:if ((10 < 20) ^ (20 < 10)) NSLog("Expression is true");
Chapter 8 - The Basics of Object Oriented Programming in Objective-C
Within this chapter the instances of the displayAccountInfo method should use %li directives instead of %i. For example:-(void) displayAccountInfo { NSLog (@"Account Number %li has a balance of %f", accountNumber, accountBalance); }
9.1 Default Property Synthesis
The code example is missing an '_' character in the enableVolume() method. It should read:- (void)enableVolume { _volumeControl.enable = YES; } @end
Section 9.5 - Dictionary Literals
The following code sample should include an @ symbol:
NSDictionary *bookListing = @{key1 : object1, key2 : object2, key3 : object3};
Section 11.4
The return type for the convertTemp method should be declared as (IBAction) and not (void):- (IBAction) convertTemp: (id) sender { double fahrenheit = [_tempText.text doubleValue]; double celsius = (fahrenheit - 32) / 1.8; NSString *resultString = [[NSString alloc] initWithFormat: @"Celsius %f", celsius]; _resultLabel.text = resultString; }
Section 11.4
Text refers to an NSString object named resultText. This should be resultString:In doing so, we declare a pointer to this new object and call it resultText.
Chapter 12 - Writing Code to Hide the iPad Keyboard
When touching the background of the example view, the keyboard is not hidden. This can be resolved by removing the backgroundTouched: method from the HideKeyboardViewController.m file and replacing it with the following method:- (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event { UITouch *touch = [[event allTouches] anyObject]; if ([_textField isFirstResponder] && [touch view] != _textField) { [_textField resignFirstResponder]; } [super touchesBegan:touches withEvent:event]; }
Section 16.4
This section refers to the Edit -> Pin menu. This should read Editor -> Pin.Section 17.2
The instructions in this section indicate that the second label should be placed to the right of the first label. In fact, this should be placed to the left of the first label.Section 19.2
Instructions currently read:Next, with the text field selected, locate the CenterX Alignment constraint in the Document Outline panel (Figure 19 3) and create a new outlet for this object named centerConstraint
This paragraph should read as follows:
Next, with the view selected, locate the CenterX Alignment constraint in the Document Outline panel (Figure 19 3) and create a new outlet for this object named centerConstraint
Section 21.2
The code example listed at the end of section 21.2 shows the outlet for scene1Label as being of type UIButton. This should be UILabel and read as follows:#import <UIKit/UIKit.h> @interface StoryboardViewController : UIViewController @property (strong, nonatomic) IBOutlet UILabel *scene1Label; @end
Section 21.8
In Section 21.8 be sure to save the StoryBoardViewController.m file after adding the returned: method and before establishing the unwind segue. Failure to save the file will result in the returned: method not appearing when connecting to the Exit icon.
Section 21.9
Instructions should read: "...display the Attribute Inspector (View -> Utilities -> Show Attribute Inspector)..."
Section 24.6
The image shown in Figure 24-5 incorrectly shows the outlet connection being established to the CarTableViewController.h file. This should show the connection being made to the CarTableViewCell.h file.
Chapter 40
When compiling the application using Mac OS X 10.8.2, the compiler will report that the "/usr/include/sqlite3.h" file cannot be found. This is due to the fact that the sqlite3.h file has been removed from this location on Mac OS X 10.8 and is now located in the iOS SDK folder. The example will compile if the following #import directive is used in the DatabaseViewController.h file:#import <sqlite3.h>
Section 42.5
The steps in this section refer to a file named DatabaseViewController.h. This should be CoreDataViewController.h.In addition, the code example includes an import directive for a file named coreDataAppDelegate.h. This should be CoreDataAppDelegate.h.
Section 49.5
The steps in this section state that an outlet named imageview should be established. This should actually be named imageView. The corrected text should read:"Release the line and, in the resulting connection panel, establish an outlet connection named imageView. On completion of the connection, select MyCollectionViewCell.h in the project navigator and verify that it reads as follows:
#import <UIKit/UIKit.h> @interface MyCollectionViewCell : UICollectionViewCell
@property (strong, nonatomic) IBOutlet UIImageView *imageView;
@end
Section 50.7
Section 50.7 should read:Next, select the "MyCollectionDemoViewController.m" file and modify the viewDidLoad: method to change the layout to our new layout class and to add a pinch gesture recognizer configured to call a method named handlePinch::
Section 71.6
Section refers to a method named postMessage. The method is actually named sendPost.
If you have encountered an issue with the book not listed above please contact us as at [email protected] and we will work to resolve the issue for you as quickly as possible.