title: NSThread data corruption
body: <p>I have a Thread called 10 times:</p>
  
  <pre><code>[NSThread detachNewThreadSelector:@selector(workInBackground:) toTarget:self withObject:sendArray];
  </code></pre>
  
  <p>This is the "workInBackground" method:</p>
  
  <pre><code>- (void)workInBackground:(NSArray*)dataArray{
      NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; //  create release pool
      // display dataArray sent from Main Thread
      NSLog(@"%i, %@", [[dataArray objectAtIndex:0] intValue], [dataArray objectAtIndex:1]);
  
      // Fetch data from URL
      NSString *myURL = [NSString stringWithFormat:@"http://somesite.com/index.php?s=%@", [dataArray objectAtIndex:1]];
      NSURL *url = [[NSURL alloc] initWithString:myURL];
      NSString *strResult = [[NSString alloc] initWithContentsOfURL:url encoding:NSUTF8StringEncoding error:nil];
  
      // display dataArray sent from Main Thread ... AGAIN
      NSLog(@"this will show");
      NSLog(@"%i, %@", [[dataArray objectAtIndex:0] intValue], [dataArray objectAtIndex:1]);
      NSLog(@"this will not show");
  
      // Code that returns super cool data to the main thread
  
      [pool release]; // empty pool
  </code></pre>
  
  <p>I'm not 100% sure that data does corrupt but I don't understand why does the same line of code (NSLog) crash the app. I have to use data from my dataArray after the Fetch from URL but can't.</p>
  
  <p>I'm new to Objective C so I'm sorry if my error is obvious :)</p>
  
  <p>-- UPDATE -- object sent to this method wasn't retained and that was the problem!</p>