I have a class that uses a modified array, which is modified once after a large number of readings (new elements appear).
The problem is that when it comes time to mutate the array, reading continues to flow.
Currently, in order to avoid this problem every time she reads something, she does it on the copy:
[[theArray copy] operation]
A copy becomes very expensive, especially when there is no need (all those times when the array does not mutate).
How to block an array to delay access to it when it mutates?
source
share