title: NSHashTable retaining weak reference
body: <p>So, apple's documentation for <code>[NSHashTable weakObjectsHashTable]</code> states: </p>
  
  <blockquote>
    <p>Returns a new hash table for storing weak references to its contents.</p>
  </blockquote>
  
  <p>So, when I run the following code...</p>
  
  <pre><code>NSHashTable *hashTable = [NSHashTable weakObjectsHashTable];
  ABC *object = [[ABC alloc] init];
  [hashTable addObject:object];
  NSLog(@"%@", [hashTable anyObject]);
  object = nil;
  NSLog(@"%@", [hashTable anyObject]);
  </code></pre>
  
  <p>The output is: </p>
  
  <pre><code>2017-09-18 12:57:02.801 Test2[6912:640614] &lt;ABC: 0x608000014eb0&gt;
  2017-09-18 12:57:02.801 Test2[6912:640614] &lt;ABC: 0x608000014eb0&gt;
  2017-09-18 12:57:02.803 Test2[6912:640614] dealloc // (dealloc of ABC)
  </code></pre>
  
  <p>It looks like calling <code>NSLog(@"%@", [hashTable anyObject]);</code> is retaining the object.</p>
  
  <p>If I call,</p>
  
  <pre><code>NSHashTable *hashTable = [NSHashTable weakObjectsHashTable];
  ABC *object = [[ABC alloc] init];
  [hashTable addObject:object];
  //NSLog(@"%@", [hashTable anyObject]);
  object = nil;
  NSLog(@"%@", [hashTable anyObject]);
  </code></pre>
  
  <p>The ouput is as expected:</p>
  
  <pre><code>2017-09-18 13:00:23.949 Test2[6936:645459] dealloc
  2017-09-18 13:00:23.949 Test2[6936:645459] (null)
  </code></pre>
  
  <p>Can someone tell me where my misunderstanding is?</p>