title: Call a delegate's method within a background
body: <p>this is my first question here, so excuse me if I made any mistakes!</p>
  
  <p>In my iPhone project I have a method running in a thread which takes a long time to execute (that's why it runs in a thread).</p>
  
  <pre><code>[NSThread detachNewThreadSelector:@selector(methodToBeCalledInAThread) toTarget:self withObject:nil];
  
  // ...
  
  -(void)methodToBeCalledInAThread {  
      MyClass *myClass = [[MyClass alloc] init];  
      [myClass setDelegate:self]; 
      [myClass veryIntensiveComputing];   
      [myClass release];
  }
  </code></pre>
  
  <p>My goal is to notifiy the ViewController calling this method of any progress going on in this method. This is why I set the ViewController as a delegate of the class.</p>
  
  <p>Now in the expensive method I do the following:</p>
  
  <pre><code>if(self.delegate != nil) {
      [self.delegate madeSomeProgress];
  }
  </code></pre>
  
  <p>But unfortunately this does not work, because (I think) I'm in a background thread. </p>
  
  <p>How do I achieve to notify the delegate of any changes with the method being executed asynchronously?</p>