display a window while quitting

  • Hello,

    I want to be able to display a window saying that the app is quitting
    while quitting, but I only want it to display if there is a wait
    greater than 2 seconds. I attempted creating a timer in
    applicationWillTerminate: but it did not fire. Is there a way to do
    this?

    Thanks,
    Mitchell Livingston
  • on 12/3/07 9:58 AM, <livings124...> purportedly said:

    > I want to be able to display a window saying that the app is quitting
    > while quitting, but I only want it to display if there is a wait
    > greater than 2 seconds. I attempted creating a timer in
    > applicationWillTerminate: but it did not fire. Is there a way to do
    > this?

    Chances are, this is either because you never return control to the run
    loop, so the timer can never fire; or you return control to the run loop and
    your app terminates (probably before your cleanup code is complete).

    The easiest choice that comes to mind is to implement
    -applicationShouldTerminate: and return NO if you haven't run the cleanup,
    or YES if you have. Make sure your cleanup code runs "asynchronously"--i.e.
    returns control to the run loop so your timer will fire. On completion, flag
    that cleanup is done and call -terminate: on NSApp to actually exit.

    Best,

    Keary Suska
    Esoteritech, Inc.
    "Demystifying technology for your home or business"
previous month december 2007 next month
MTWTFSS
          1 2
3 4 5 6 7 8 9
10 11 12 13 14 15 16
17 18 19 20 21 22 23
24 25 26 27 28 29 30
31            
Go to today