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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T00:09:34+00:00 2026-06-05T00:09:34+00:00

i use some function in for loop to calculate new position of object: …some

  • 0

i use some function in for loop to calculate new position of object:

...some code....

for (int i = self.frame.origin.x; i <= 710; ++i) {
    CGPoint newP = CGPointMake(i, 1);
    float posY = a * pow((newP.x - w.x),2) - w.y;

    CGPoint result = CGPointMake(i, posY);
    [NSThread sleepForTimeInterval:1];
    self.frame = CGRectMake(result.x, result.y, self.frame.size.width, self.frame.size.height);
    NSLog(@"[%f, %f]", result.x, result.y);
}

, but object is still in place.

console print:

2012-06-04 23:13:19.183 PERT Estimator[326:707] [304.000000, 169.499985]
2012-06-04 23:13:20.195 PERT Estimator[326:707] [305.000000, 165.172806]
2012-06-04 23:13:21.197 PERT Estimator[326:707] [306.000000, 160.856293]
2012-06-04 23:13:22.200 PERT Estimator[326:707] [307.000000, 156.550461]
2012-06-04 23:13:23.225 PERT Estimator[326:707] [308.000000, 152.255295]
2012-06-04 23:13:24.265 PERT Estimator[326:707] [309.000000, 147.970810]

etc…

what’s wrong?

  • 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-05T00:09:37+00:00Added an answer on June 5, 2026 at 12:09 am

    Wow, you should really be using an animation block for that.

    /* Starting position  */
    [self setFrame:CGRectMake(304, 169.499985,self.frame.size.width, self.frame.size.height)];
    
    [UIView animateWithDuration:1.0
                          delay:0.0 
                        options:UIViewAnimationCurveEaseOut 
                     animations:^ 
                     {
                         [self setFrame:CGRectMake(309, 147, 320,110)];
                     } 
                     completion:^(BOOL finished) 
                     {
                         if ( finished )
                             /* Animation is done, do something, or not */
                             NSLog(@"[%f, %f]", result.x, result.y);
                    }];
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

In JavaScript, if I have some function I can use the arguments object to
I am trying to use the outer function with predict in some classification code
I am beginner in python, and I need to use some thirdparty function which
I have an AS3 class with some getVideo function. I want to use this
I use a function that sends emails to some users. I use the following
i want to use .animate function but i have some problems i want to
I use this function substr(tbarticles.articlebody,1,200) as description1 in a query but for some articles
i'm a beginner to php. i need to use php function which process some
Consider a repeating loop of setInterval(function(){ $('.test').each(function(idx){ var duration = 1000; $(this).delay(duration*idx); Some stuff
I've got some very simple code below that I want to use as a

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.