title: Pass an NSMutableArray or NSMutableDictionary to a method -- can you add to it?
body: <p>If I have an <code>NSMutableArray</code> or <code>NSMutableDictionary</code> and pass it to a method a la:</p>
  
  <pre><code>-(void)addToThisArray:(NSMutableArray *)theMutableArray
  {
      [theMutableArray addObject:@"test"];
  }
  </code></pre>
  
  <p>and call it like:</p>
  
  <pre><code> NSMutableArray *theMutableArrayToPass = [[NSMutableArray alloc] init];
   [theMutableArrayToPass addObject:@"2"];
   [self addToThisArray:theMutableArrayToPass];
  </code></pre>
  
  <p>Is this a valid way to alter an <code>NSMutableArray</code> or <code>NSMutableDictionary</code>?  I, of course, would do much more to the array/dictionary than this example, but I am used to Perl, and we pass by reference all the time.</p>