title: Weak object in an NSDictionary?
body: <p>I would like to store a zeroing weak reference to an object in a <code>NSDictionary</code>. This is for a reference to a parent <code>NSDictionary</code>, so I can crawl back up a large structure without searching.</p>
  
  <p>I can not use <code>__weak</code> here; even if my local reference is weak, the <code>NSDictionary</code> will store a strong reference to the object that was weakly referenced. And, of course, <code>NSDictionary</code> can't have <code>nil</code> objects.</p>
  
  <p>I'm on iOS, not Mac, so <code>NSHashTable</code> isn't available. And I only want one object to be weak; the rest should still be strong.</p>
  
  <p>(I'm going to post my answer, so I have something to mark as accepted if there's no better answer. But I'm hoping someone has a better answer.)</p>