此代碼運行時沒有崩潰,我沒有在文檔中看到任何內容,但是它確實安全嗎?在enumerateObjectsUsingBlock:?期間使用removeObject安全嗎?
[mutableArray enumerateObjectsUsingBlock:^(id obj, NSUInteger idx, BOOL *stop) {
// do some stuff to obj before removing it
[mutableArray removeObject:obj];
}];
這裏有一些有用的答案:[集合在被列舉的目標C錯誤時發生了變化](http://stackoverflow.com/questions/14457369/collection-was-mutated-while-being-enumerated-error-in-jective -c) – Monolo