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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T20:08:16+00:00 2026-06-09T20:08:16+00:00

Hello every time i try to record the date with CFAbsoluteTimeGetCurrent(); my app ignores

  • 0

Hello every time i try to record the date with CFAbsoluteTimeGetCurrent(); my app ignores the rest of the buttons, it’s as if it takes over all memory and blocks all user input. I was wondering what i am doing wrong? I thought of making a function showtime() but i dont know how to pass values between functions from toggleRecording to showtime so that my method would work if this would even solve the problem. Below is my code:

- (IBAction)toggleRecording:(id)sender
{
    // Start recording if there isn't a recording running. Stop recording if there is.
    [[self recordButton] setEnabled:NO];
    if (![[[self captureManager] recorder] isRecording]){
        [[self captureManager] startRecording];

        /* figure out a day to record for every half a second
         while([[[self captureManager]recorder] isRecording]){
         CFTimeInterval startTime = CFAbsoluteTimeGetCurrent();
         NSLog(@" time is %i", startTime);
         }

        */
    }
    else
        [[self captureManager] stopRecording];


}

-(void)showtime:(id)sender{
    while([[[self captureManager]recorder] isRecording]){
        CFTimeInterval startTime = CFAbsoluteTimeGetCurrent();
        NSLog(@" time is %f", startTime);
    }
}
  • 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-09T20:08:17+00:00Added an answer on June 9, 2026 at 8:08 pm

    An application has to run the event loop to receive the events. While your own code is doing something else (here it’s doing a “while” loop), events are queued and not delivered until your code returns.

    Schematically, an application is doing something like:

    while(1) {
        event = _UIReceiveNextQueuedEvent();
        _UIProcessEvent(event); // <- this calls -showTime:
    }
    

    If you want to record time while not blocking the loop, you will have to schedule an NSTimer every 0.5s and invalidate it as soon as recording is turned off.

    Something like:

    - (void)showTime:(id)sender
    {
        if ([[[self captureManager]recorder] isRecording]) {
            [NSTimer scheduledTimerWithTimeInterval:0.5f target:self selector:@selector(timerFired:) userInfo:nil repeats:YES];
        }
    }
    
    - (void)timerFired:(NSTimer *)timer
    {
        if ([[[self captureManager]recorder] isRecording]) {
            CFTimeInterval startTime = CFAbsoluteTimeGetCurrent();
            NSLog(@" time is %f", startTime);
        } else {
            [timer invalidate];
        }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Hello every One i am trying to get Ist date of All months in
Every time I try this the browser raises an error app.py import web urls
Hello Everyone, I have made so many Flash presentations, but every time i stuck
Every time I test out my app on the emulator. An error occurred with
I try to send a mail via php to an yahoo recipient. Every time
Every time i try to work with sencha touch to get a json feed
Hello all I'm trying to do the following insert to my database however every
Hello I am trying to update the textview at every certain time, but it
I have an issue where every time I try to run a project (that
Every time, when I try to add a new controller in CodeIniter, I get

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.