title: Make main thread wait until all other threads done in IPhone sdk
body: <p>I am working on threads in objective C for the first time in my coding experience. In my app i needs to download some assets in two threads. After completion of downloading i have to start my main thread which will make use of the downloaded assets in threads. So i wrote some code like this</p>
  
  <pre><code>NSThread *threadPlayer1 = [[NSThread alloc]initWithTarget:self selector:@selector(getPlayer1Assets) object:nil];
              
  [threadPlayer1 start];
              
  NSThread *threadPlayer2 = [[NSThread alloc]initWithTarget:self selector:@selector(getPlayer2Assets) object:nil];
              
  [threadPlayer2 start];
  
  [self performSelectorOnMainThread:@selector(introducePlayer1) withObject:nil waitUntilDone:YES];
  </code></pre>
  
  <p>I wrote waituntilDone to Yes but it waits until the first thread completes only.
  so if i wants to wait untill all the two threads completed what should i do? can any one suggest with sample code snippets.</p>