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

  • Home
  • SEARCH
  • 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 9322287
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 19, 20262026-06-19T04:03:19+00:00 2026-06-19T04:03:19+00:00

Im trying to make a animation with pictures using this code: NSMutableArray *imageArray =

  • 0

Im trying to make a animation with pictures using this code:

NSMutableArray *imageArray = [[NSMutableArray alloc] initWithCapacity:22];
int i;
for (i =1; i < 22; i++) {
    [imageArray addObject:[UIImage imageNamed:[NSString stringWithFormat:@"fbAnimation%d.png", i]]];
    //make it animate
    self.fbLogin.animationImages = [NSArray arrayWithArray:imageArray];
    self.fbLogin.animationDuration =0.8;
    self.fbLogin.animationRepeatCount = 5;
    [self.fbLogin startAnimating];
}
    int j;
    NSMutableArray *imageLoading = [[NSMutableArray alloc] initWithCapacity:4];
    for (j = 1; j < 4; j++) {
        [imageLoading addObject:[UIImage imageNamed:[NSString stringWithFormat:@"loading%d.png", j]]];

        //make it animate
        self.fbLogin.animationImages = [NSArray arrayWithArray:imageLoading];
        self.fbLogin.animationDuration = 1;
        self.fbLogin.animationRepeatCount = 5;
        [self.fbLogin startAnimating];
}

}

The problem is that either way I’ve tried it so far just one animation gets executed on the screen. I want the first animation to run and then the second “Loading…” until all other data from facebook is ready.

  • 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-19T04:03:20+00:00Added an answer on June 19, 2026 at 4:03 am

    Firstly, you are calling [self.fbLogin startAnimating] and resetting the animationImages array each time you go round each for loop. You should move them outside the loops – you only need to start each animation once.
    Secondly, the second for loop will be executed immediately after the first, so the result I would expect would be for the second animation to appear, and not the first.
    One way of getting round the problem would be to put the code for the second animation in a separate method, and then arrange for it to be called after the first has finished by calling:

    [self performSelector:@selector(animation2) withObject:nil afterDelay:durationOfPreviousAnimation];
    

    at the end of the first for loop. I’m assuming that since this is animation code we’re guaranteed to be on the main thread.

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

Sidebar

Related Questions

I'm trying to make an animated slide show. This code works but without animation
I am trying to make this animation to stop after running the first time,
I am trying to make this animation loop $(.jquery_bounce).ready(function(){ $(img, this).animate({ marginLeft : '20px'
I'm trying to make a loader gif using CSS animation and transforms instead. Unfortunately,
I'm trying to make an application that runs an animation. To do this I've
I'm trying to make an animation in iOS using the animateWithDuration: method. I'm moving
Im trying to make this image fade into the one below it using a
I'm trying to make a push animation from one side using a CATransition .
I'm trying to make the flip-clock animation, I find this tutorial very interesting http://www.voyce.com/index.php/2010/04/10/creating-an-ipad-flip-clock-with-core-animation/
i'm trying to make a simple animation using keyframes, but it only works in

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.