I utilize a UILongPressGestureRecognizer in my app. This is a continuous gesture recognizer which means it continuously fires the selector for the target it was initialized with. I would like the selector to be fired only once. I have tried to prevent further selectors being fired by setting the gesture recognizer's enabled property to Note the first time the selector is fired, but this only takes effect after the selector is fired again. How can I ensure the selector is fired only once?
A:
I have not been able to find a way to force the selector to be fired only once. The workaround I have employed is to set the gesture recognizer's enabled property to NO after the first time it fires and then to re-enable it when necessary.
Run Loop
2010-05-21 06:18:16