iOS exception - Collection was mutated while being enumerated

iOS exception - Collection was mutated while being enumerated


some related discuss

issue sample1

Before you loop over the array, you can create a new array with the elements. So when the original looped array is mutated (either by you, or by its owner) the array you loop over stays intact.

issue sample2


The error occurs because you are adding new objects to termsArray within the for loop
  • Create a new empty array (e.g.newTermsArray)
  • In the first loop create and add these new items to newTermsArray
  • Then you will need a second loop to add the items from newTermsArray back into the original termsArray

@synchronized (yourobject)
   
{
   
//do something with your object
   
}


and for how to analyze Call Stack Symbols, you need to know iOS crash report 

留言

Google

本月熱門文章

水電行介紹---台北市大同區塔城街17號的富安水電行---斷垣殘壁內找到的甲級電匠師傅^^!!

熱門文章

企鵝妹/柳允進 史上最暈的TT三分鐘完整版一次看個夠

香港朋友,真的對唔住,台灣出了這種中共的幫兇!

陳昇 Bobby Chen【把悲傷留給自己 I left sadness to myself】Official Music Video

裝潢師傅貼圖來了唷

[黑金] 台南88槍擊案主犯國民黨學甲區黨部主委王文宗 也擔任統促黨幹部

新手自建監控雲最快的方式:推薦QNAP NAS 搭配QVR Pro

堅持5個月!反送中示威者六大特色 6 features of Hong Kong Anti-ELAB Protesters│老外看香港│郝毅博 Ben Hedges│新唐人電視台

香港朋友看服貿 - 嗨,我是香港人,一個CEPA的受害者。