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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T13:35:04+00:00 2026-06-07T13:35:04+00:00

In my app, I run numerous animations, moving objects and shapes etc. Many of

  • 0

In my app, I run numerous animations, moving objects and shapes etc.
Many of the animations lead on to the animation of other objects.
A problem with the application is that if an animation is running and you start another that involves one of the objects currently being animated, the screen goes white/we get unexpected results.

I worked up some sample code to show what we are trying to do:

UIButton *button;
BOOL currentlyShowingQuestion;
- (void)viewDidLoad
{
    [self moveButton:button];
    currentlyShowingQuestion = NO;
    [NSTimer scheduledTimerWithTimeInterval:.1 target:self selector:@selector(hasBoolChanged) userInfo:nil repeats:YES];
}
- (void)moveButton:(UIButton *)buttonToUse {
    currentlyShowingQuestion = YES;
    NSLog(@"moveButton Called!  Yippee!!!!!!!");
    [UIView animateWithDuration:0.5 delay:0.5 options:nil animations:^{
        buttonToUse.frame = CGRectMake(10, 10, 300, 440);
    } completion:^(BOOL finished){
        currentlyShowingQuestion = NO;
    }];
}

-(void)hasBoolChanged {
    if (currentlyShowingQuestion == YES) {
        NSLog(@"Yes");
    }
    else if (currentlyShowingQuestion == NO) {
        NSLog(@"No");
    }
}

What I end up actually seeing is like the currentlyShowingQuestion BOOL both get changed instantly when the method is run, so it changes to YES and instantly back to NO. Then the animation runs. Why is this? What’s wrong with the order?

Any help appreciated.
Sorry about the code formatting – I couldn’t figure out the syntax here.

Thanks in advance,

Sam

  • 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-07T13:35:06+00:00Added an answer on June 7, 2026 at 1:35 pm

    I don’t really understand what you try to achieve. At the beginning you start a timer that checks whether the value of the boolean has changed. I think it is kind of an overkill for this task but thats ok.
    Your animation is delayed 0.5s for some reason and then you have a 0.5s duration for an animation and that is really fast so it could seem that you instantly change the value.

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

Sidebar

Related Questions

The app will run fine, then crash - literally every other time. It seems
I'm testing my application as grails run-app. I have read How to remove app
We have an application in Grails 2.0 that we have working when we run
I am developing an android application by Android OS 2.3,My app run in Nexus
In our application we've run into an error numerous times where we get error
Can a LINQ enabled app run on a machine that only has the .NET
I have a problem with an app that takes an XML feed, parses it,
i am developing adobe flex application using flashbuilder4.5 tool total app run configures desktop
I understand that you can run .NET application from network share. I have done
When I run my iOS app in simulator after updating numerous images within the

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.