Re: Recurrent NSInvocationOperations on an NSOperationQueue?
Re: Recurrent NSInvocationOperations on an NSOperationQueue?
- Subject: Re: Recurrent NSInvocationOperations on an NSOperationQueue?
- From: Ken Thomases <email@hidden>
- Date: Fri, 14 Aug 2015 18:15:41 -0500
On Aug 14, 2015, at 5:23 PM, Carl Hoefs <email@hidden> wrote:
> I'm trying to automatically re-queue an NSInvocationOperation to an NSOperationQueue every n seconds, but I can't get it to work.
From the NSOperation class overview:
"An operation object is a single-shot object—that is, it executes its task once and cannot be used to execute it again."
Among other reasons, the behavior of -isFinished and -isCancelled dictate this. Those are only allowed to transition from one value to the other at most once.
You'll need to create a new operation each time you want to queue a particular invocation.
Regards,
Ken
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden