And anyway, you'll need a lock anyway, because someone could be
accessing the array from another thread while you're replacing it,
and then you'd release it from out under their feet. Also keep in
mind that you also have to lock the objects *in* the array if
they're mutable and accessed from another thread, or if they could
get released on one of the threads.
Errr... not clear enough: What I meant is that you need to lock the
object containing the array (so you can change or examine the iVar
pointing to the array), the array (so you don't release it while
someone else is iterating over it or whatever) and the objects in the
array. The latter is not necessary for immutable objects, of course.