title: Will NSNotificationCenter call back method be called in main thread or background thread?
body: <p>My code is just play a downloaded mp4 files and register the view controller to observe the notification of end of player.</p>
  
  <p>It works pretty good in not only iOS5 but also iOS4.</p>
  
  <p><strong>But I just want to know for sure that whether the call back method by NotificationCenter will be called in background thread or main thread.
  (loadMoviePlayerStateChanged:(NSNotification*)notification is call back method in my code)
  Do anyone know exactly about this?</strong></p>
  
  <pre><code>- (void) playMovie:(NSURL *)fileURL {
   MPMoviePlayerViewController *MPVC = [[MPMoviePlayerViewController alloc] initWithContentURL:fileURL];
  
   self.mMPVC = MPVC;
   self.mMPVC.moviePlayer.controlStyle = MPMovieControlStyleFullscreen;
  
   [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(loadMoviePlayerStateChanged:) 
                                                name:MPMoviePlayerLoadStateDidChangeNotification 
                                              object:self.mMPVC.moviePlayer];
  
   [MPVC.moviePlayer prepareToPlay];
   [MPVC release];
  }
  
  - (void) loadMoviePlayerStateChanged:(NSNotification*)notification {
  int loadState = self.mMPVC.moviePlayer.loadState;
  if(loadState &amp; MPMovieLoadStateUnknown) {
      IGLog(@"The load state is not known at this time.");
      return;
  } 
  
  [[NSNotificationCenter defaultCenter] removeObserver:self 
                                                  name:MPMoviePlayerLoadStateDidChangeNotification 
                                                object:self.mMPVC.moviePlayer];
  
  [self.mMPVC.view setFrame:self.view.bounds];
  
  [[NSNotificationCenter defaultCenter] addObserver:self 
                                           selector:@selector(moviePlayBackDidFinish:)
                                               name:MPMoviePlayerPlaybackDidFinishNotification  
                                             object:self.mMPVC.moviePlayer];
  
  /* if I do not use performSelectorOnMainThread method to add subview to UIViewController`s view, 
  the view of MPMoviePlayerViewController would not be removed from superview normally */
  
  [self.view performSelectorOnMainThread:@selector(addSubview:) 
                              withObject:self.mMPVC.view 
                           waitUntilDone:YES];
  [self.mMPVC.moviePlayer play];
  }
  
  - (void) moviePlayBackDidFinish:(NSNotification*)notification {
  [self.mMPVC.moviePlayer stop];
  [self.mMPVC.moviePlayer.view removeFromSuperview];
  
  NSString* dstFilePath = [[_mPopupVC.mSelectedMovie decryptionFilePath] stringByAppendingPathExtension:@"mp4"];
  [[NSFileManager defaultManager] removeItemAtPath:dstFilePath error:nil];
  
  [[NSNotificationCenter defaultCenter] removeObserver:self 
                                                  name:MPMoviePlayerPlaybackDidFinishNotification 
                                                object:self.mMPVC.moviePlayer];
  }
  </code></pre>