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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T22:32:03+00:00 2026-05-26T22:32:03+00:00

My program moves an object along CGPoints. When a new amount of CGPoints are

  • 0

My program moves an object along CGPoints. When a new amount of CGPoints are created it moves to the new points just fine. After about 5-10 object changes my application crashes and Xcode gets the beach ball.

Here is the animation:

-(void)animateDot {
    double x1 = dotMotion.center.x;
    double y1 = dotMotion.center.y;
    double x2 = (*doodlePoints)[dotLocation].x;
    double y2 = (*doodlePoints)[dotLocation].y;
    dist = sqrt(((x2 - x1)*(x2 - x1)) + ((y2 - y1)*(y2 - y1))); 
    if (dist < 0.01){
        dist = 1;
    }
    delay = dist/100.0;
    [UIView beginAnimations:nil context:nil];
    [UIView setAnimationDelegate:self];
    [UIView setAnimationBeginsFromCurrentState:YES];
    [UIView setAnimationDidStopSelector:@selector(animateDot)];
    [UIView setAnimationDuration:delay];
    dotMotion.center = (*doodlePoints)[dotLocation];
    if (dotLocation == doodlePoints->size()-1){
        dotMotion.bounds = CGRectMake(0, 0, 16, 16);
    } else {
        dotMotion.bounds = CGRectMake(0, 0, 8, 8);
    }
    [UIView commitAnimations];
    dotLocation = (dotLocation +1)%doodlePoints->size();
    if (dotLocation == 0 && stopAnimation != YES){
        dotLocation = (dotLocation +1)%doodlePoints->size();
    }
}

The button that you click for a new object has this: (and I do call isAnimating == TRUE once, and never call it false, so it shouldn’t be doing animationDot again).

    if (isAnimating == TRUE) {
} else {
    [doodlePad animateDot];
}

My Errors include:

Warning: Unable to reach Previous state:

Also the stack shows a very large amount of (a couple thousand)

# <Not Fetched> //# = 1 to X amount

and also my stack starts with:

0 szone_malloc_should_clear
1 malloc_zone_malloc
2 _CFRuntimeCreateInstance
3 CFBasicHashCreate
4 __CFDictionaryCreateGeneric
5 CFDictionaryCreate
6 -[__NSPlaceholderDictionary int.. //I can't see the rest
7 +[NSDictionary dictionaryWithObj... //as above

then 8 through 100 has

# -[DoodlePad animateDot]
# -[UIViewAnimationState sendDel... //can't see the rest
# -[UIViewAnimationState popAni... //above

after this its all # <Not Fetched>

I have a feeling I need a way of releasing memory or remove the animation before the next CGPoints are created.

Can you explain what means? I couldn’t find anyone with an error like this on Google. How can this crash be fixed?

  • 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-26T22:32:04+00:00Added an answer on May 26, 2026 at 10:32 pm

    Your selector is of the wrong form. It should accept three parameters :::. The other thing is that you are doing some heavy stuff with heavy objects (UI objects are heavy). It looks like your delay may take values as small as 0.01 (and smaller!!!). (Its not a delay, but duration in your case.) This sort of animation does not make sense, as fps on iPhone is 60.

    (Are you trying to replace game loop with animations? :))

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

Sidebar

Related Questions

I am contemplating writing a program that will move some newly created dirs to
My program uses sqlite3 plus python. It works fine with python 2.6.2 I moved
Strange program hang, what does this mean in debug? After attaching windbg I found
In my application, I used to create along string of async operations, which passed
In my Flash program, I am trying to run a function within an object.
I'm fairly new to Java and I'm trying to create a GUI application with
I'm writing a program consisting of dynamically created panels that each have a few
Problem: move an object along a straight line at a constant speed in the
My program moves files from one folder to another immediately upon creation. The files
I'm developing a game where each object has its own thread where it moves

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.