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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T14:41:23+00:00 2026-06-15T14:41:23+00:00

I have some animation which needs to appear on screen at very specific timings,

  • 0

I have some animation which needs to appear on screen at very specific timings, these are stored in SQLite database. What I am planning to do is use nstimer to keep time and pop the animation when the specific time is reached.

Im thinking of using an NSTimer to count for the duration of the sound file and animation then when certain points are reached pop an on screen animation. The problem is the set timing are like this 55.715000 seconds so are very accurate and these need to sync with an audio track that will be played with the animation.

Firstly is this even possible, secondly how can i compare such specific timings the problem i seem to be facing is the code can’t run quick enough and the time jumps more than .001 of a second.

I have no knowledge of openGLES or Cocos2d and learning these is not really feasible for the time scales.

  • 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-15T14:41:24+00:00Added an answer on June 15, 2026 at 2:41 pm

    Regardless of how accurate your timings are, you aren’t going to get the device to display more frequently than about 60Hz (16.7 ms per frame). As I see it, you have at least two options here:

    1) Use a CADisplayLink callback to check the playback progress of the audio and trigger each animation as it becomes timely.

    Display link timers are created in a similar way to regular NSTimers:

    -(void)viewDidLoad
    {
        // ...
        self.displayLink = [CADisplayLink displayLinkWithTarget:self selector:@selector(scheduleAnimations:)];
        [self.displayLink addToRunLoop:[NSRunLoop mainRunLoop] forMode:NSDefaultRunLoopMode];
    }
    
    - (void)scheduleAnimations:(CADisplayLink *)displayLink
    {
        // get playback time from player object
        // iterate queue of timings
        //     if the timestamp of a timing is equal to or less than the playback time
        //         create its animation for immediate execution
        //         remove it from the queue
    }
    

    2) Create a collection of animations, setting their respective beginTime properties to the appropriate trigger time (or, if using implicit or block-based animations, use the delay parameter).

    [CATransaction begin];
    // iterate collection of timings
        CABasicAnimation *animation = [CABasicAnimation animationWithKeyPath:@"key"];
        animation.startTime = /* time to trigger animation */
        animation.removedOnCompletion = NO;
        [layer addAnimation:animation forKey:nil];
    [CATransaction commit];
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a WPF user control which needs to validate some fields. It is
I'd like to have a splash screen with some image animation. The image is
So I have some animation blocks to create some very simple animations on my
Title is quite self explanatory, but I have some animation being done in a
I have added some animation using jquery but it's not working: $('.test-container').click(function(){ $(this).css('background-color', 'rgb(119,
i creating an application with movie animation , i have a animation some group
I'm working with sprite animation (OpenGL + C++). I have some trouble working with
Doing some jquery animation. I have certain divs set up with an attribute of
As titled, how can I do that? I have been reading some Silverlight/WPF animation
I have a storyboard like the following Duration=0:0:1 Completed=DeviceExplorer_Completed> The animation for some reason

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.