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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T06:25:04+00:00 2026-05-16T06:25:04+00:00

I posted another question similar. This is my old code as some ppl say

  • 0

I posted another question similar. This is my old code as some ppl say it would be even better, but there i didnt found a solution to release the allocated memory.

imageArray_danceright =  [[NSArray alloc] initWithObjects:
[UIImage imageNamed:@"FrankieDanceRetime_0001.jpg"],
.. 40 images
[UIImage imageNamed:@"FrankieDanceRetime_00040.jpg"],nil];


imageArray_danceleft =  [[NSArray alloc] initWithObjects:
[UIImage imageNamed:@"FrankieDanceRetime_0041.jpg"],
.. 40 images
[UIImage imageNamed:@"FrankieDanceRetime_00080.jpg"],nil];

imageArray_stand= [[NSArray alloc] initWithObjects:
[UIImage imageNamed:@"FrankieSingtRetime_0001.jpg"],
[UIImage imageNamed:@"FrankieSingtRetime_0002.jpg"],
[UIImage imageNamed:@"FrankieSingtRetime_0003.jpg"],nil];

//start animation
myimageview.animationImages = imageArray_stand;
myimageview.animationDuration = 0.23;
myimageview.contentMode = UIViewContentModeBottomLeft;
myimageview.animationRepeatCount = 0.0;
myimageview.image = [myimageview.animationImages objectAtIndex:1];
[myimageview startAnimating];


- (void) touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event {
  touch = [[event allTouches] anyObject];
  if ([touch view] == overlay_fuesserechts) { 
     [myimageview setAnimationImages:imageArray_danceright]; 
      myimageview.animationDuration = 2.0;
      myimageview.contentMode = UIViewContentModeBottomLeft;
      myimageview.animationRepeatCount = 1;
      [myimageview startAnimating];
  }
  if ([touch view] == overlay_fuesselinks) { 
     [myimageview setAnimationImages:imageArray_danceleft]; 
      myimageview.animationDuration = 2.0;
      myimageview.contentMode = UIViewContentModeBottomLeft;
      myimageview.animationRepeatCount = 1;
     [myimageview startAnimating];
  }

Its works fine.. just when i look in Instrument/Allocation, it does not release the memory.
It starts with 8mb for the ‘stand’ anim, goes up to 32mb for fuesserechts and when i click fuesselinks it goes up to 55mb (i have 6 more anim.. so a few more and it just crash)
When I do set [myimageview setAnimationImages:nil]; (in touchesBegan) for each setAnimationImages … i still does not release the Memory. All Allocatoins Overall bytes, still increase.
When I do set [myimageview.animationImages release]; in (touchesbegan) for each setAnimationImages… it even crash after a few touches.

Thanks
Chris

  • 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-16T06:25:04+00:00Added an answer on May 16, 2026 at 6:25 am

    Ok, now I see your original code I think I see where the advice came from. Instead of imageNamed: you might want to use imageWithContentsOfFile: (as you did in your earlier question). The former caches its images whereas the latter does not. I’m not convinced this is your problem here though.

    What is less clear is where this code fits into your bigger system. I presume the first stretch of code (all the imageNamed: calls) is in an init method? Is that the case?

    Is the //start animation section really in the same method, or somewhere else. This is not clear because you then include your touchesBegan: method in its entirety.

    You also don’t show where myimageview is being created – and who owns it. If you create it within the same class then you should also be releasing it in dealloc. Talking of dealloc it seems to be missing from this version – was that only in the new version? You need it here (more so).

    I know its hard to post snippets of code unambiguously – but in this case I think these are the things that need clarification.

    If your setup code (the imageNamed: stretch) is being called every time that may well explain it – as might the lack of releasing myimageview.

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

Sidebar

Related Questions

i posted another question about this, but i think this one will be more
this might seem like a weird question, earlier I posted another question on ASP
A similar question is posted here . I have an undirected graph with Vertex
This is similar to my last question. I'm making a simple tcp/ip chat program
Update So in my Original question I was just frustrated because I was being
I am a novice to mysql DB. I am trying to run the MYSQL
I have recently put together a JWS application which gets it's argument from a
TL;DR Xaml feels opaque to me, why did removing TargetName from an animation fail
Environment .NET 3.5 Self Servicing LLBL Pro 2.6 I know I might be doing
I am trying to use a Canvas to display objects that have world location

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.