title: Ignore UIButton's touch event in a long task time
body: <p>I want to ignore all touch events of a button while a long task is running.</p>
  
  <pre><code>- (void)buttonAction{
      NSLog(@"click!");
      button.enabled = NO;
      [self longTask];
  }
  
  - (void)longTask{
      NSLog(@"task begin!");
      sleep(5);
      NSLog(@"task finished!");
      button.enabled = YES;
  }
  </code></pre>
  
  <p>During the longTask time, I click the button again, it really nothing happens. BUT, when the longTask is finished, it automatically respond to the click events and execute the longTask again!
  How many times I clicked  when the button's enabled value is 'NO', the longTask will perform how many times.</p>
  
  <pre><code>2013-08-20 09:24:49.478 AppName[2518:c07] click!
  2013-08-20 09:24:49.479 AppName[2518:c07] task begin!
  2013-08-20 09:24:54.481 AppName[2518:c07] task finished!
  2013-08-20 09:24:54.482 AppName[2518:c07] click!
  2013-08-20 09:24:54.482 AppName[2518:c07] task begin!
  2013-08-20 09:24:59.484 AppName[2518:c07] task finished!
  </code></pre>
  
  <p>I tried to set userInteractionEnabled=NO but got the same result.</p>
  
  <p>How can make it ignores all touch events when a long task is running and never performs the task?  In other words, only executes the longTask when the button is clicked at it's enabled value is 'YES'?</p>
  
  <p>Thanks any help!</p>