Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9000691
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T00:20:32+00:00 2026-06-16T00:20:32+00:00

My current solution to schedule the same selector on an object for n times

  • 0

My current solution to schedule the same selector on an object for n times is via creating an array of instances of a “messanger” class where as property I have calltime and type of the selector I want to call plus the object reference that should call the selector.

I then check against this array in the update method of the parent node class where I added all those objects.

Is there any way to do this via the schedule method?

The shared director doesn’t give me any method that helps. I am fairly happy with my solution but not quiet sure if it is the best one.

EDIT: I tried the answer suggested and unfortunately did not work.

Here is the code:

    [f schedule:@selector(activateForShort) interval:0 repeat:0 delay:1.0f];
    [f schedule:@selector(activateForShort) interval:0 repeat:0 delay:3.0f];
    [f schedule:@selector(activateForShort) interval:0 repeat:0 delay:5.0f];
    [f schedule:@selector(activateForShort) interval:0 repeat:0 delay:7.0f];
    [f schedule:@selector(activateForShort) interval:0 repeat:0 delay:9.0f];
    [f schedule:@selector(activateForShort) interval:0 repeat:0 delay:12.0f];
     ....
    [f schedule:@selector(activateForShort) interval:0 repeat:0 delay:152.0f];
    [f schedule:@selector(activateForShort) interval:0 repeat:0 delay:177.0f];
    [f schedule:@selector(activateForShort) interval:0 repeat:0 delay:199.0f];
    [f schedule:@selector(activateForShort) interval:0 repeat:0 delay:212.0f];

f is an object and it calls the selector “activateForShort” only once.

I tried modifying the interval and repeat value to 1 but did not work.

What I want to achieve is to call it at a specific time (e.g. 1.0f, 212.0f).

Any suggestion will be wellcome 🙂

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-16T00:20:32+00:00Added an answer on June 16, 2026 at 12:20 am

    The solution suggested sadly didn’t work. See edit.

    I created a specific action class and created an NSMutableArray filled of instances of this class, and in the update method of the class wherever I needed those actions to be scheduled I do:

    -(void ) update:(ccTime) delta
    {
    timeElapsed+=delta;
    
    for(int i=lastButtonCallIndex; i<[callsSchedulers count]; i++ )
    {
        Call * buttonCall = [callsSchedulers objectAtIndex:i];
        if (buttonCall.callingTime<timeElapsed)
        {
            if(buttonCall.called==FALSE)
            {
                [buttonCall call]; //Where the call method has a reference to the button object I wanted to activate - a Call object is initialized with this reference.
                lastButtonCallIndex++;
            }
        }
        else
        {
            break;
        }
    }    
    

    }

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

My current solution consists of several Class Libraries and a Website. I'm in the
I have two projects in the current solution: abc.Dashboard abc.ThingyService abc.ThingyService needs to be
I have solution A which defines public class Foo, and solution B which references
Does VS have an environment variable for the path to the current solution? For
I current have a solution with an Azure WCF service and a Windows Phone
I want to get a reference to the current solution, using the DTE2 object
Simple question may have a simple answer, but my current solution seems horrible. local
In my current solution I have 18 projects and most of them have their
Current Solution So I have something very similar to [HttpPost] public ActionResult Upload() {
My current solution will suck sometimes EDIT For those who don't understand,see this example:

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.