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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T17:10:56+00:00 2026-06-09T17:10:56+00:00

I notice in my program that when I call NSRunAlertPanel(), while it waits to

  • 0

I notice in my program that when I call NSRunAlertPanel(), while it waits to return (the user has not yet clicked a button) NSTimer() does not fire. It fires regularly, perfectly until the NSRunAlertPanel() line, but then is not called again until the user clicked a button on the dialog.

Is there a way to keep the timer running, even while the dialog is on the screen?

  • 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-09T17:10:58+00:00Added an answer on June 9, 2026 at 5:10 pm

    The alert panel is starting its own event loop (via -[NSApplication runModalForWindow:], separate from the (presumably main) event loop that the timer was originally scheduled on. This is to prevent the user from interacting with any other elements of the application until the alert is handled.

    Off the top of my head, there are two ways I can think of to make the timer still fire while the panel is presented: run the main run loop, and add the timer to the panel’s run loop. I’m honestly not sure how either of these will work out.

    For the first, you can get the application’s main run loop easily enough: [NSRunLoop mainRunLoop], and then tell it to runUntilDate: for a short time (less than a second) in the future. This will require you to set up a (while) loop, where you let the main run loop and the modal run loop run for a short while alternately. The problem here is that letting the main run loop be active will allow input to be processed, defeating the modality of the panel.

    For the second, you just take your reference to the timer and then do [[NSRunLoop currentRunLoop] addTimer:forMode:]. What I’m not sure about here is how the timer’s fire date will interact with being re-added to another loop, but you can try it out.

    Hopefully I’m being an idiot and missing something really obvious, and another answer will appear shortly with the correct solution.

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

Sidebar

Related Questions

Back story: While running a program under strace I notice that '/dev/urandom' is being
I noticed while making a program that a lot of my int type variables
For those not familiar with fraps. Its screen recording program that you can trigger
It is not a secret that on CUDA 4.x the first call to cudaMalloc
I noticed that my program was crashing because it was running out of memory.
I noticed that in Windows 7 there is a Program called Windows Fax and
I am just beginning to program in Java and I noticed that String is
I'm working on a database program and I noticed that when I'm doing queries
I'm currently parallelizing program using openmp on a 4-core phenom2. However I noticed that
While reading the K&R 2nd edition I noticed that the programs always began with

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.