16
14

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

【エラー】Collection was mutated while being enumerated.

Posted at

##意味
列挙子つかってアクセスしてる最中に配列の中身を変更すんじゃねぇよ、次のオブジェクトわかんなくなるやろぼけ

##解決策
for (id *obj in [hogeArray reverseObjectEnumerator]) {

}

ってかんじにreverseObjectEnumeratorを使う。
arrayが逆順になるので中身を変更しても次のオブジェクトは変わんないのでだいじょうぶ

16
14
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
16
14

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?