アプリとメソッドに更新ボタンがありdoRefresh
、バックグラウンドスレッドで実行されます。ここで、ユーザーがダブルクリックを押すと、メソッドdoRefresh
は2回以上実行されます。ユーザーがダブルクリックを押してさらにクリックすると、以前のすべてのスレッドが機能を停止して完了します。そして、新しいメソッドが新しいスレッドで実行を開始します。どうすればいいですか?
詳細:CoreDataを使用して、塗りつぶし関係オブジェクトの長いXMLファイルを解析します。たとえば、ユーザーが更新ボタンを10回押すと、次のエラーが発生します。
reason: '*** Collection <__NSCFSet: 0x5b7dd50> was mutated while being enumerated.<CFBasicHash 0x5b7dd50 [0x1503400]>{type = mutable set, count = 8