I want to keep a mutable array
of weak references to a group of UIViews
. NSMapTable
is perfect for this need, except for one detail... NSMapTable
wants a key for every value it holds.
Is there something like an NSMapArray
? If not, do I need to generate throw-away unique keys for all the values I store? Should I use NSUUID
to generate the key names?
EDIT: Please not that I'm talking about truly weak, self-zeroing references. CFArrays and NSValue solutions store references which won't nil themselves out when their referenced object gets deallocated...they'll just end up as junk pointers.