Remove message queue events

Asked

Viewed 49 times

1

How can I prevent my class (Uiview) from receiving a ringtone event when there are still similar events in the message queue?

  • What a queue of messages are these that you refer to?

  • You could explain better what you want?

  • It’s the event queue from the main thread. You can associate an event queue to a thread (https://developer.apple.com/library/ios/documentation/General/Conceptual/Devpedia-CocoaApp/MainEventLoop.html). I want to cancel the processing of a ringtone event (Uicontroleventtouchdraginside, to be exact) if this event has already occurred but has not been processed yet.

  • @Filipebeck Why you need to cancel processing a ringtone event?

  • I’m working on a music recording app. On some screens I have a selector of categories (percussion, strings, keyboard...), an instrument selector (electric guitar, piano...) related to the selected category, and a list of tracks related to the selected instrument. This list is retrieved from a remote server. When I select a new category, the instrument selector switches to the items in the new category.

  • This change is animated, and at the end of the animation I send the event Uicontroleventvaluechanged (misspelled in the comment above), which will be received and processed by the controller, which will display the new list. The problem is that this event was being sent twice in a row at startup. I have already found the place where it happens. Now I need to modify in a way that does not change the behavior in other screens that use the same class.

  • put the code, to try to help.

Show 2 more comments
No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.