@Tom, thank you so much for the advice and detailed explanation as to what happens when the setFocus is nilled.
I’d like to know if there’s a harm in not reaching the ended event. When I set setFocus to nil, I also trigger things that should happen when the touch reaches “end” (or “cancelled”) state. It appears that the same object can be touched again and respond to “began” phase (but I need to test this thoroughly to ensure it does.) If the object can be touched again, and can trigger “began” phase without an issue, nilling focus would be a real good solution for me. Hmmm… when the object is touched again, does it trigger “cancelled” event from the previous touch? If it does, this is actually the most perfect solution for me.
What I’m trying to address is a bug that isn’t too easy to reproduce, but can happen every now and then. The problem is, even when the finger is lifted off the screen (and off of the object), my game sometimes does not register that the touch event has ended. When this happens, the game eventually comes to a freezing point. Hard exit is the only option at that point.
In fact, if there’s a way to tell the game that the touch is cancelled upon specific flag/trigger and properly reaches the “cancelled” state even when finger is still touching the object, that would help me set up a very good work around to my problem. (And nilling focus appears to work the way I hoped it would so far.)
That said, the best solution would be, for the device/simulator to always and accurately detect the end of the touch event. If it can truly reach the end state when nothing is touching the screen, I wouldn’t have to find the workaround to force the cancellation event.
Is there a built in function that I can fire off to force the object to register the fact the touch has already been ended? When the screen is no longer being touched, I really want my object to register that it is not being touched…
Naomi
[import]uid: 67217 topic_id: 21513 reply_id: 86152[/import]