Errata: pg 121 (pg 116 eBooks) - Detecting Shakes code


#1

In the pdf version SafariBooksOnline, the code listing on page 116 (page 121 of the print version) has the following:

#import <UIKit/UIKit.h>

@interface HypnosisView : UIView <UIAccelerometerDelegate> {
...

HypnosisViewController implements the protocol. The code should be

#import <UIKit/UIKit.h>

@interface HypnosisView : UIView {
...

NB: The sample code downloaded from BNR is correct.


#2

Arg. You are right: that is an error. (Originally, we had the view as the delegate of the accelerometer, but after a thoughtful discussion, Joe and I decided that the controller should be the delegate. And I left that declaration in there.) Thanks to you, it will be fixed in the next printing. Sorry!