I have refresh button in my app and method 'doRefresh
' who run in background thread. Now if user press double click - method doRefresh
run 2 times and more.
I want if user press double click and more clicks, all previos threads stop work and complete. And new method begin run in new thread. How I to do this?
More details: I work with CoreData, and parse long XML file for fill relationship objects. When user press on refresh button 10 times for example, hi catch next error:
reason: '*** Collection <__NSCFSet: 0x5b7dd50> was mutated while being enumerated.<CFBasicHash 0x5b7dd50 [0x1503400]>{type = mutable set, count = 8