A call of [self takePicture] , which ultimately will retry, which is useless and wasteful, because you do not even give your application time to get additional accelerometers. The accelerating value will probably never change before the stack ends.
What you probably want to do here is a method called part of a second later, for example.
[self performSelector: @selector(takePicture) withObject:nil afterDelay: 0.01]; return;
This will cause the loop to call your method again after 10 milliseconds (0.01 seconds).
source share