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 8020111
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T21:35:42+00:00 2026-06-04T21:35:42+00:00

I have four NSTimers that work fine. The only problem is that two should

  • 0

I have four NSTimers that work fine. The only problem is that two should fire and then the other two should fire in the middle of the first two. Here is my code:

   initTimer = [NSTimer scheduledTimerWithTimeInterval:1.5 target:self selector: @selector(initText) userInfo:nil repeats:YES];
   animateTimer = [NSTimer scheduledTimerWithTimeInterval:1.5 target:self selector: @selector(textGlow) userInfo:nil repeats:YES];
   initTimer1 = [NSTimer scheduledTimerWithTimeInterval:1.5 target:self selector: @selector(initText1) userInfo:nil repeats:YES];
   animateTimer1 = [NSTimer scheduledTimerWithTimeInterval:1.5 target:self selector: @selector(textGlow1) userInfo:nil repeats:YES];

The initText and initText1 methods create a UILabel with lazy instantiation and place them on the screen on the same spot. The textGlow and textGlow1 methods animate the text to make it grow bigger and fade away. I want initText1 and textGlow1 to fire in the middle of initText and textGlow. For example, let’s say each of these methods takes 2 seconds (I set the animation duration to 2 seconds). I want initText and textGlow to fire, and then one second in, initText1 and textGlow1 to fire.

Thanks. If you need any of my other code to help answer the question, just ask.

———-EDIT————-

@MDT That worked but there is a problem. What I did was I placed the code above of initTimer1 and animateTimer1 in new functions called initTimer1Wrapper and animateTimer1Wrapper. Then I did your code [self performSelector:@selector(initText1Wrapper) withObject:nil afterDelay:1.0]; and duplicated it but changed the selector to animateText1Wrapper. What happens is initText and textGlow will fire as planned, and then also as planned initTimer1 and animateTimer1 will fire one second in, but what also happens unexpectedly is that initText and textGlow do not finish their remaining one second; the animations just stop. I believe this is because they are UIView animations with [UIView beginAnimation:@"name" context:nil] and [UIView commitAnimations] and more then 1 UIView animations can’t run at the same time.

To fix this, should I use Core Animation (which I do not know anything about) or is there another solution? Thanks.

———-EDIT2————-

Also, just if it is important for you to know, I will dismiss this animation with a UIGestureRecognizer.
Something like:

if(screenIsTapped){
    [initTimer invalidate];
    [animateTimer invalidate];
    [initTimer1 invalidate];
    [animateTimer1 invalidate];
}
  • 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-04T21:35:43+00:00Added an answer on June 4, 2026 at 9:35 pm

    Try placing something like this inside initText or textGlow.

    [self performSelector:@selector(initText1) withObject:nil afterDelay:1.0];
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

i have four tables user-question contains two columns: questionID, userID, the questions that the
i have four imageviews in a linear layout in such a manner that only
I have four activities namely, Demo_tabActivity.java [main activity] Tabhost.java The below two activities are
I have four activities namely, Demo_tabActivity.java [main activity] Tabhost.java The below two activities are
I have four textfields that bind to the model key path. If a number
I have four arrays that are coming in from the client. Let's say that
I have four tables in my database and i want to join that's and
I have four images on a page that on hover, needs to replace the
I have four input boxes. If the user fills the first box and clicks
I have four buttons that are going to be styled in the same way

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.