• 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: Carl Hoefs <email@hidden>
  • Date: Fri, 14 Aug 2015 18:07:38 -0700

> On Aug 14, 2015, at 5:46 PM, Carl Hoefs <email@hidden> wrote:
>
>
>> On Aug 14, 2015, at 4:15 PM, Ken Thomases <email@hidden> wrote:
>>
>> You'll need to create a new operation each time you want to queue a particular invocation.
>
> Yes, I'm doing that. The problem is finding a mechanism to re-queue a new operation from the current one after it is done, so the queue can be empty for a time.

Here's what I'm trying to do, but in code rather than words:

    . . .
    [self doStatusChecks];  // start endless checking at 1-min intervals
    . . .


- (void)doStatusChecks
{
    [jobQueue addOperation:[[NSInvocationOperation alloc] initWithTarget:self
                  selector:@selector(checkStatus) object:nil]];
}

- (void)checkStatus
{
    //    Access device & read status
    //    If bad, do work...

    //    Enqueue another operation, but after 60 sec delay

    [self performSelector:@selector(doStatusChecks)
               withObject:nil
               afterDelay:60.0];  // <-- This never fires!

    [self doStatusChecks];        // <-- Fires immediately, but not what I want
}

-Carl


_______________________________________________

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: Ken Thomases <email@hidden>
References: 
 >Recurrent NSInvocationOperations on an NSOperationQueue? (From: Carl Hoefs <email@hidden>)
 >Re: Recurrent NSInvocationOperations on an NSOperationQueue? (From: Ken Thomases <email@hidden>)
 >Re: Recurrent NSInvocationOperations on an NSOperationQueue? (From: Carl Hoefs <email@hidden>)

  • Prev by Date: Re: Recurrent NSInvocationOperations on an NSOperationQueue?
  • Next by Date: Re: Recurrent NSInvocationOperations on an NSOperationQueue?
  • Previous by thread: Re: Recurrent NSInvocationOperations on an NSOperationQueue?
  • Next by thread: Re: Recurrent NSInvocationOperations on an NSOperationQueue?
  • Index(es):
    • Date
    • Thread