title: Memory management and performSelectorInBackground:
body: <p>Which is right? This:</p>
  
  <pre><code>NSArray* foo = [[NSArray alloc] initWithObjects:@"a", @"b", nil];
  [bar performSelectorInBackground:@selector(baz:) withObject:foo];
  
  - (void)baz:(NSArray*)foo {
      ...
      [foo release];
  }
  </code></pre>
  
  <p>Or:</p>
  
  <pre><code>NSArray* foo = [[[NSArray alloc] initWithObjects:@"a", @"b", nil] autorelease];
  [bar performSelectorInBackground:@selector(baz:) withObject:foo];
  
  - (void)baz:(NSArray*)foo {
      NSAutoreleasePool* pool = [[NSAutoreleasePool alloc] init];
      ...
      [pool release];
  }
  </code></pre>
  
  <p>I know the first one works, but Clang complains about it, so I wonder if there's a better pattern to use.</p>
  
  <p>I would "just try out" the 2nd one, but with autoreleasing, who knows whether the absence of <code>EXC_BAD_ACCESS</code> means that you're doing it right or that you just got lucky...</p>