for (id {object} in {collection}) {...}" )
You shall not be able to modify the collection (add or remove) during enumeration.
Because, thread will have a lock on the resources being used.
for that either go with the :
1)
for(NSUInteger i=0 ; i< [ {collection} length];i++){…}
2) Put the add/remove logic in another thread
Hope this helps!
No comments:
Post a Comment