App crashes with reason: Collection <__NSArrayM: 0x7071700> was mutated while being enumerated

前端 未结 3 634
离开以前
离开以前 2021-01-24 13:04

Can you please help me to find reason why my app crashes after clicking on segmented control? Not allways, but usualy after some clicks.

Error message:

         


        
3条回答
  •  后悔当初
    2021-01-24 13:58

    solved

    I had same problem in coredata objects enumeration.

    Do not change sub object which relies in ARRAY on which Loop is Running

    Like ==>>

    If I change/Modify object while in loop, it will give this error.

     for (LoadList *objLL in ArrLoadList) {             // here Enumaration is Going on
            // here I removed objects in ArrLoadList and reassign the ArrLoadList .. 
            // it will give me this error 
            // So Don't change the Main Array object 
     }
    

提交回复
热议问题