Re: Cancelable NSBlockOperations

2010-01-14 Thread Michael Ash
On Thu, Jan 14, 2010 at 3:15 PM, Jamie Hardt wrote: > On Jan 14, 2010, at 12:07 PM, Nick Zitzmann wrote: > >> Sorry, forgot that block operations, unlike invocation operations, don't >> take arguments. (Guess which one I use more often?) Yes, I'd try what you're >> proposing. > > It was a good t

Re: Cancelable NSBlockOperations

2010-01-14 Thread Nick Zitzmann
On Jan 14, 2010, at 1:15 PM, Jamie Hardt wrote: > ...fails horribly. The debugger looks strange, I can't make sense of it. What fails horribly, creating the block or adding it? More details, please. Nick Zitzmann ___ Co

Re: Cancelable NSBlockOperations

2010-01-14 Thread Jamie Hardt
On Jan 14, 2010, at 12:07 PM, Nick Zitzmann wrote: > Sorry, forgot that block operations, unlike invocation operations, don't take > arguments. (Guess which one I use more often?) Yes, I'd try what you're > proposing. It was a good though, but doing something like this... NSBlockOperation *b =

Re: Cancelable NSBlockOperations

2010-01-14 Thread Nick Zitzmann
On Jan 14, 2010, at 1:02 PM, Jamie Hardt wrote: > The block that NSBlockOperation takes is (void)^(void), do you mean I have to > declare it outside of the block scope and let the block copy the reference > when it invokes? Sorry, forgot that block operations, unlike invocation operations, don

Re: Cancelable NSBlockOperations

2010-01-14 Thread Jamie Hardt
On Jan 14, 2010, at 11:59 AM, Nick Zitzmann wrote: > On Jan 14, 2010, at 12:30 PM, Jamie Hardt wrote: > >> How does one support -cancel in an NSBlockOperation? Testing [NSThread >> isCancelled] doesn't appear to work. > > The same way you do it with NSInvocationOperations - pass in the operat

Re: Cancelable NSBlockOperations

2010-01-14 Thread Nick Zitzmann
On Jan 14, 2010, at 12:30 PM, Jamie Hardt wrote: > How does one support -cancel in an NSBlockOperation? Testing [NSThread > isCancelled] doesn't appear to work. The same way you do it with NSInvocationOperations - pass in the operation as an argument to the block and check the object's cance

Re: Cancelable NSBlockOperations

2010-01-14 Thread Mike Abdullah
On 14 Jan 2010, at 19:30, Jamie Hardt wrote: > A quick question... > > How does one support -cancel in an NSBlockOperation? Testing [NSThread > isCancelled] doesn't appear to work. Because it's the block, not the thread that gets cancelled___ Coc

Cancelable NSBlockOperations

2010-01-14 Thread Jamie Hardt
A quick question... How does one support -cancel in an NSBlockOperation? Testing [NSThread isCancelled] doesn't appear to work. Jamie___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to t