Sohu Tech Products
Jan 26, 2022 · Mobile Development
Crash Caused by Mutating a Collection During Enumeration and the Mechanics of copy vs mutableCopy in Objective‑C
This article documents a runtime crash triggered by mutating an NSMutableSet while enumerating it, explains how the Objective‑C copy attribute works, demonstrates shallow and deep copy behavior for strings and collections, and provides low‑level source analysis of the copy implementation in the Apple runtime.
CopyDeepCopyMutableSet
0 likes · 14 min read