Gesture failure after having it working twice

So I have added a UILongPressGesture to two buttons on a view. Everything was working fine. I could both tap the buttons and hold the buttons and get proper events for both.

After adding in some more code which is completely unrelated as far as I can tell, the normal action on the button quits working and I can no longer get a tap, I only get long presses no matter how quick I tap the button.

This has happened twice now. I did a small sample project to prove that it worked with both tap and long press to make sure I wasn’t crazy. Then I recreated the original project piece by piece until it failed again. The last thing I added was a second view. After my project broke again I deleted the new view, but the project is still broken. No more taps even though this code was working before.

I’m looking for any advice. Has anyone seen this before and have suggestions for tracking down the problem? The only thing I know to do at this point is rebuild it from scratch again and try to get it back to the state the current broken project is in and then compare the two projects as text files and see if there is a difference. Fun! Yay!

If there is any concerned about these files I just ran a little test using CleanMyMac and it deleted most of the files in the Caches folder, including all the Xojo. I then ran a Xojo debug test and it created a new Xojo folder. There were a BUNCH of folders in the Caches.

I deleted all the caches and nothing changed. I went through the process again and read through the docs again and what I’ve found is that at some point the defaults are no longer the documented defaults.

The long press gesture has a .5 second press default. For some reason once the project gets complex enough the default gets lost or set to 0 somehow. If I manually set the press time it works like it should. I don’t know if this is some kind of compiler thing or what would cause the default to change, but it happens consistently for me once the project becomes reasonably complex.

I don’t understand how that would happen, but it does. It always works on a basic project and always fails for me once the project becomes complicated enough. At least for an always of about 5 attempts.

I don’t know if I should file this as a bug or just set the time and move on, but at least I have a solution now.

Since it is obviously a declare, it would probably help to show what you got. Several pairs of eyes are better than one.

The problem happens in both simulator and device. I’m using the class from iOSKit.
UIKit.UILongPressGestureRecognizer is dragged onto a view twice. One for each button.

I put a MsgBox in the gesture event of each instance.

This code is in the open event of the view.

[code]Declare sub addGestureRecognizer lib “UIKit” selector “addGestureRecognizer:” (ctrl as ptr, recognizer as ptr)

addGestureRecognizer(bFastForward.handle, UILongPressGestureRecognizerFFWD)
addGestureRecognizer(bRewind.handle, UILongPressGestureRecognizerRWD)
UILongPressGestureRecognizerRWD.minimumPressDuration = .3
UILongPressGestureRecognizerFFWD.minimumPressDuration = .3[/code]

The duration must be specified in my project now or all I get is an immediate long press when I leave off the duration. In a new project there is no problem. The default duration works fine.