Organizational Research By

Surprising Reserch Topic

how to cancel out of operation created with addoperationwithblock using -'iphone,ios,nsoperation,nsoperationqueue'


how to cancel out of operation created with addoperationwithblock  using -'iphone,ios,nsoperation,nsoperationqueue'

I'm using NSOperationQueue's addOperationWithBlock.  From within the block, how do I check to see if I'm supposed to cancel the operation?  Or access any NSOperation properties/methods?

[myOperationQueue addOperationWithBlock: ^{

  while ( /* long running loop */ )
  {
      // how to determine here if I need to cancel?
      // for that matter, access any NSOperation properties/methods?

  }

}];


Is the better way to do this to use a NSBlockOperation?
    

asked Sep 7, 2015 by rajesh
0 votes
9 views



Related Hot Questions

Your answer

Your name to display (optional):
Privacy: Your email address will only be used for sending these notifications.
Anti-spam verification:
To avoid this verification in future, please log in or register.

...