June 2011
Intermediate to advanced
590 pages
19h 31m
English
In HypnosisViewController.m, add the following implementation of the UIAccelerometer delegate method, accelerometer:didAccelerate:. This method will log accelerometer updates to the console. Notice that the types of the two parameters are different even though they look similar:
- (void)accelerometer:(UIAccelerometer *)meter
didAccelerate:(UIAcceleration *)accel
{
NSLog(@"%f, %f, %f", [accel x], [accel y], [accel z]);
}
Build and run the application on your device. Watch the console as you rotate and shake the phone to get a feel for the data that the accelerometer ...
Read now
Unlock full access