title: Objective C, NSMutableDictionary reference count
body: <pre><code>    NSMutableDictionary *attrs = [nodeAttributes objectForKey:UUID];//nodeAttributes is NSMutalbleDictionary
      if (attrs == nil) {
           attrs = [[NSMutableDictionary alloc] init];
           [nodeAttributes setObject:attrs forKey:UUID];
           [attrs release];
      }
  </code></pre>
  
  <p>I am not sure this code will works...Should I have something like this instead of this</p>
  
  <pre><code>    NSMutableDictionary *attrs = [nodeAttributes objectForKey:UUID];//nodeAttributes is NSMutalbleDictionary
      if (attrs == nil) {
           attrs = [[NSMutableDictionary alloc] init];
           [nodeAttributes setObject:[attrs retain] forKey:UUID];
           [attrs release];
      }
  </code></pre>
  
  <p>I am not sure if setObject method will increase the reference count...</p>