title: NSArray objects go out of scope after returning pointer
body: <p>I am attempting to use the below code in a function to return an array of dictionary objects.  Unfortunately, after the return to the next function in the stack all of the rows in the mutable array have become 'out of scope'.  From my understanding, the array should retain the row (dictionary) object automatically so even after the return, where the row pointer goes out of scope, the row objects should still have a retain count of 1.  What am I doing wrong here?  How do I build this array in such a way that the objects it contains don't get released?</p>
  
  <pre><code>for (int i = 1; i &lt; nRows; i++)
  {
    NSMutableDictionary* row = [[[NSMutableDictionary alloc] initWithCapacity:nColumns] ];
    for(int j = 0; j &lt; nColumns; j++)
    {
      NSString* key = [[NSString stringWithUTF8String:azResult[j]] ];
      NSString* value = [[NSString stringWithUTF8String:azResult[(i*nColumns)+j]] ];
  
      [row setValue:value forKey:key];
    }
    [dataTable addObject:row];
  }
  
  return dataTable;
  </code></pre>