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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T02:26:15+00:00 2026-05-25T02:26:15+00:00

I am animating images with UIImageView: imageView.animationImages = [NSArray arrayWithArray:imgNameArr]; imageView.animationDuration = 2; imageView.animationRepeatCount

  • 0

I am animating images with UIImageView:

    imageView.animationImages = [NSArray arrayWithArray:imgNameArr];    
    imageView.animationDuration = 2;
    imageView.animationRepeatCount = 0;
    [imageView startAnimating];

At some point later I am trying to change images to some new ones:

    [imageView stopAnimating];
    imageView.animationImages = nil;
    [imageView.animationImages release]; 
    imageView.animationImages = [NSArray arrayWithObjects:  
            [UIImage imageNamed:@"1.png"],
    [UIImage imageNamed:@"2.png"],
    nil];
    [imageView setAnimationDuration:1];
    [imageView startAnimating];

This does NOT work. My app either crashes or images disappear. I’ve seen a few people have the same problem and they create various workaround. Is something wrong with my code? Can something be done?

In addition I discovered that with this code below the object disappears at end of animation.

    int x = rect.origin.x;
int y = rect.origin.y;
int w = rect.size.width;    
    float _frequency = 0;
    CAKeyframeAnimation *pathAnimation = [CAKeyframeAnimation animationWithKeyPath:@"position"];
pathAnimation.duration = speed;
pathAnimation.calculationMode = kCAAnimationPaced;
pathAnimation.fillMode = kCAFillModeForwards;
pathAnimation.removedOnCompletion = NO;

CGMutablePathRef pointPath = CGPathCreateMutable();
CGPathMoveToPoint(pointPath, NULL, rect.origin.x, rect.origin.y);

    do {        
        CGFloat yVal = sin (_frequency * M_PI/180);
        CGPathAddLineToPoint(pointPath, NULL, x, y + yVal * 15);
        _frequency += freq;
        x--;        
    } while (x > w);//does not go outside

pathAnimation.path = pointPath;
CGPathRelease(pointPath);

[imageView.layer addAnimation:pathAnimation forKey:@"pathAnimation"];
[imageView release];
  • 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-05-25T02:26:16+00:00Added an answer on May 25, 2026 at 2:26 am

    Since animationImages is a property, you don’t need to set it to nil, and releasing it AFTER you set it to nil does nothing (it sends release to nil). Releasing it beforehand will cause a crash. Just set it to the new value, or to nil. You shouldn’t be releasing another object’s properties.

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

Sidebar

Related Questions

I'm having some problems with UIImageView animations. I've created three NSArray objects containing the
I'm trying to create a button which displays animated images. I read in this
In my project, I made an animation for my UIImageView using some pngs. I
I'm trying to subclass UIImageView in order to create an instance of the subclass
I'm trying to animate a sequence of images and this could easily be done
I'd like help on some strategies to sequence some animations. I subclassed UIImageView so
I'm currently using a UIImageView with an array of images to create a small
Just requesting a little advice animating images on the iphone. I'm building an app
I have a problem. I have a UIImageView and 144 fullscreen images (960x640). And
Is it possible to implement animating sequence of images using CAAnimation? And i dont

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.