Collection NSArrayM was mutated while being enumerated iOS swift

 Problem:

While deleting an object from array produces error array was never muted while enumerated.


Solution:

You can easily get what the error is?. Because it says "array was muted while being enumerated".If you are using one array inside loop if you are deleting one object in the array it will be affect the loop count.So better you can use for each looping.In that count will not be used for enumeration.If ou delete objects it will not affect the loop...

Comments

Popular posts from this blog

Invalid bundle error while upload the app to the app Store

Convert NsNumber, NSDate to String in iOS Swift

Global LocationManager Singleton class iOS Swift