title: Timed selector never performed
body: <p>I've added an observer for my method:</p>
  
  <pre><code>[[NSNotificationCenter defaultCenter] addObserver:self 
                                           selector:@selector(closeViewAfterUpdating) 
                                               name:@"labelUpdatedShouldReturn" 
                                             object:nil];
  </code></pre>
  
  <p>Then my relevant methods:</p>
  
  <pre><code>-(void)closeViewAfterUpdating; {
  NSLog(@"Part 1 called");
  [self performSelector:@selector(closeViewAfterUpdating2) withObject:nil afterDelay:2.0];
  }
  
  -(void)closeViewAfterUpdating2; {
  NSLog(@"Part 2 called");
  [self dismissModalViewControllerAnimated:YES];
  }
  </code></pre>
  
  <p>The only reason why I've split this method into two parts is so that I can have a delay before the method is fired.  </p>
  
  <p>The problem is, the second method is never called.  My <code>NSLog</code> output shows <code>Part 1 called</code>, but it never fires part 2.  Any ideas?</p>
  
  <p><strong>EDIT: I'm calling the notification from a background thread, does that make a difference by any chance?</strong></p>
  
  <p>Here's how I'm creating my background thread:</p>
  
  <pre><code>[NSThread detachNewThreadSelector:@selector(getWeather) toTarget:self withObject:nil];
  </code></pre>
  
  <p>and in <code>getWeather</code> I have:</p>
  
  <pre><code>[[NSNotificationCenter defaultCenter] postNotificationName:@"updateZipLabel" object:textfield.text];
  </code></pre>
  
  <p>Also, calling:</p>
  
  <pre><code>[self performSelector:@selector(closeViewAfterUpdating2) withObject:nil];
  </code></pre>
  
  <p><em>does</em> work.</p>
  
  <p><strong>EDITx2: I fixed it.  Just needed to post the notification in my main thread and it worked just fine.</strong></p>