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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T13:55:57+00:00 2026-06-01T13:55:57+00:00

I have created an animated game app, In which I am using NSTimer to

  • 0

I have created an animated game app, In which I am using NSTimer to move an image after a particular interval of time.

timer = [NSTimer scheduledTimerWithTImerInterval:0.2 target:self selector:@selector(MoveVirus) userinfo:nil repeats:YES];

this timer calls up the function MoveVirus, MoverVirus moves virus (an Image on screen).

It works fine in the beginning but the speed of motion automatically increases.
The increased speed of motion destroys every further logic.

I don’t know what is the problem with it?

Please help to solve this problem.

  • 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-01T13:55:58+00:00Added an answer on June 1, 2026 at 1:55 pm

    NSTimer isn’t necessarily meant for this sort of use…From the docs on NSTimer:

    A timer is not a real-time mechanism; it fires only when one of the
    run loop modes to which the timer has been added is running and able
    to check if the timer’s firing time has passed. Because of the various
    input sources a typical run loop manages, the effective resolution of
    the time interval for a timer is limited to on the order of 50-100
    milliseconds. If a timer’s firing time occurs while the run loop is in
    a mode that is not monitoring the timer or during a long callout, the
    timer does not fire until the next time the run loop checks the timer.
    Therefore, the actual time at which the timer fires potentially can be
    a significant period of time after the scheduled firing time.

    A better approach, if you are moving UIImages that are contained in a UIImageView would be to use the class animation methods on UIView. You can still get the same result of moving the image after a particular time if you use the animation method that contains a delay. The method is:

    + (void)animateWithDuration:(NSTimeInterval)duration delay:(NSTimeInterval)delay options:(UIViewAnimationOptions)options animations:(void (^)(void))animations completion:(void (^)(BOOL finished))completion
    

    Using this method, you can specify the time of the animation (how long it takes to animate the move of your UIImages), how long to wait before starting this animation, a set on animation options, a block of animation code, and a block that executes when the animation is complete.

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

Sidebar

Related Questions

I have created a game which paints images to a JPanel. This runs with
I have a responsive layout and I've created a fading panels animated element with
I have created a custom dialog for Visual Studio Setup Project using the steps
I have created a C# class file by using a XSD-file as an input.
I have created a voice recording app. It works fine on an iPhone 3G
I am trying to animate random point that i have created so they move
I have created an app that incorporates a table view, detail view, and a
I have created an app capable of live streaming, but I currently have no
I have created a UITableView with two cells, username and password using the code
hii every one i have created a data entry screen like this in which

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.