When I select "Shake Gesture" from the Hardware menu in the iPhone simulator, my first responder always receives two shake events (with a few milliseconds in between).
Unfortunately these two events in the simulator lead to a problem with an UIScrollview
that should scroll to a specific position - what it does, but only for the first event.
So I have the following two questions (that are connected to each other somehow)...
Question 1
Why does the simulator generate two shake events for one "Shake Gesture"?
Note: These two events do not occur when testing on the real device. A shake on the real iPhone always produces one event.
Question 2
Is there a way to make sure two subsequent calls of [myScrollView setContentOffset:CGPointMake(x,0) animated:YES];
get both executed properly?
Note: What I find interesting - when I set animated:
to NO
in the setContentOffset
call, it works flawlessly - both calls are executed! Unfortunately this is not an option for the App I'm working on.
Btw, the problem is easy to reproduce. Just make two calls of setContentOffset
with animation to an UIScrollview
and find only the first executed...
[myScrollView setContentOffset:CGPointMake(300,0) animated:YES]; //this one works
[myScrollView setContentOffset:CGPointMake(100,0) animated:YES]; //this one not
Thanks in advance!
Best, Markus