-(void)accelerometer:(UIAccelerometer *)accelerometer didAccelerate:(UIAcceleration *)acceleration
{
float xx = -[acceleration x];
float yy = [acceleration y];
float angle = atan2(yy, xx);
[arrowView setTransform:CGAffineTransformMakeRotation(angle)];
}
-(void) ViewDidLoad
{
[[UIAccelerometer sharedAccelerometer] setDelegate:self];
}
Monday, August 31, 2009
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment