Re: Using NSTerminateLater with a Status Item
Re: Using NSTerminateLater with a Status Item
- Subject: Re: Using NSTerminateLater with a Status Item
- From: Olivier Lance <email@hidden>
- Date: Thu, 17 Feb 2011 10:25:09 +0100
On 15 févr. 2011, at 16:55, Jeff Johnson wrote:
> On Feb 14, 2011, at 3:25 PM, email@hidden wrote:
>> I don't know if this would fly or not but...
>>
>> Rather than conventionally returning NSTerminateLater you could try, assuming your async driver calls are run loop sources, run the run loop as required within - applicationShouldTerminate.
>>
>> This should allow you the opportunity to get a window on screen (though not necessarily using NSRunAlertPanel), process the user response, await the async callbacks and exit when your cleanup is done.
>
> No, if your app does not return from applicationShouldTerminate: within a certain number of seconds, your process will simply be killed.
I'm not even sure we can talk "seconds" here... I've tried doing a sleep in the applicationShouldTerminate:. When restarting, the application doesn't even wait a second....
I was hoping something like this would work:
• In applicationShouldTerminate: or applicationWillTerminate, spawn a process that would not be a NSBackgroundOnly/LSUIElement application.
• Have a applicationShouldTerminate: implementation that returns NSTerminateLater and displays a modal message.
In my idea, if the process ever had the time to launch and initialize, that would give me the delay I'm looking for... Unfortunately, though the process has enough time to launch (I can see its window appearing), it seems to be killed upon restart, and the dialog never appears :(
If anybody can see a reason for that, or have another idea, I'll be more than glad to try it out!
Thanks,
Olivier_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden