• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Recurrent NSInvocationOperations on an NSOperationQueue?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


  • Follow-Ups:
    • Re: Recurrent NSInvocationOperations on an NSOperationQueue?
      • From: Carl Hoefs <email@hidden>
References: 
 >Recurrent NSInvocationOperations on an NSOperationQueue? (From: Carl Hoefs <email@hidden>)

  • Prev by Date: Re: Referring to self in property initializer
  • Next by Date: Re: Referring to self in property initializer
  • Previous by thread: Recurrent NSInvocationOperations on an NSOperationQueue?
  • Next by thread: Re: Recurrent NSInvocationOperations on an NSOperationQueue?
  • Index(es):
    • Date
    • Thread