title: How to remove queued block from a GCD dispatch queue?
body: <p>I am trying to re-schedule queued block that will handle the update operations. 
  Main goal is updating UI objects (online user table...) with minimum amount of (UI update request). (Server sometimes rain down massive amount of updates, yay!)</p>
  
  <p>For simplicity main scenario is;</p>
  
  <ul>
  <li><p>The dispatch_queue_t instance (queue that will handle given UI updating block) is a serial dispatch queue (private dispatch queue)</p></li>
  <li><p>The operation (UI updating block) is scheduled with dispatch_after with t amount of time (Instead of updating for each data set update, collect update requests within t amount of time and perform a single UI update for them)</p></li>
  <li><p>In case our data set updated, check if there already exist a scheduled event. If yes, unschedule it from dispatch_queue_t instance. Then re-schedule same block with t amount of time delay.</p></li>
  </ul>
  
  <p>Also;</p>
  
  <p>t is a small amount of time interval that possibly won't be noticed by the user (like 500 ms.)
  Any alternative approach is welcome. </p>
  
  <p>My motive behind this; </p>
  
  <p>i applied same logic via Android's Handler (post &amp; removeCallbacks combination with Runnable instance) and i hope i could achieve the same on iOS.</p>
  
  <p><strong>Edit:</strong></p>
  
  <p>As @Sven suggested usage of NSOperationQueue is more suitable for the scenario as they support cancelling each NSOperation. I skimmed through documents and found;</p>
  
  <blockquote>
    <p>Canceling Operations
    Once added to an operation queue, an operation object is effectively owned by the queue and cannot be removed. The only way to dequeue an operation is to cancel it. <strong>You can cancel a single individual operation object by calling its cancel method</strong> or you can cancel all of the operation objects in a queue by calling the cancelAllOperations method of the queue object.</p>
    
    <p>You should cancel operations only when you are sure you no longer need them. Issuing a cancel command puts the operation object into the “canceled” state, which prevents it from ever being run. Because a canceled operation is still considered to be “finished”, objects that are dependent on it receive the appropriate KVO notifications to clear that dependency. Thus, it is more common to cancel all queued operations in response to some significant event, like the application quitting or the user specifically requesting the cancellation, rather than cancel operations selectively.</p>
  </blockquote>