Thank you Kyle, however, I realize, it's incredible there is no way to execute a task before quitting the app. I easily run a task at launch but I can't run a task before quit. The problem is that the task could a few minutes and the app should remain responsive to the user, in the best Mac tradition. I will struggle myself some day more on this issue. Let's cross the fingers.
Regards -- Leonardo > Da: Kyle Sluder <[email protected]> > Data: Fri, 3 Jun 2011 11:35:41 -0700 > A: Peter Lübke <[email protected]> > Cc: Leonardo <[email protected]>, Cocoa Developers > <[email protected]> > Oggetto: Re: NSTerminateLater and thread > > 2011/6/3 Peter Lübke <[email protected]>: >> Return NSTerminateCancel when applicationShouldTerminate calls >> ExecuteLogOutTask to be performed in a secondary thread. >> At the end of your ExecuteLogOutTask method, call something like >> [myApplicationDelegate performSelectorOnMainThread:(logOutTaskDidFinish) >> withObject:nil waitUntilDone:NO]. >> Then, in logOutTaskDidFinish, call NSApplication's -terminate: method and >> set a flag indicating that ExecuteLogOutTask was already executed. >> The next time applicationShouldTerminate is called, return NSTerminateNow if >> this flag is has been set so ExecuteLogOutTask is not called forever. > > That's not going to resume the aborted logout. > > Leonardo, you will need to either finish your task in the time > allotted by NSTerminateLater, or you will need to abort logout. > > --Kyle Sluder _______________________________________________ Cocoa-dev mailing list ([email protected]) 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: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to [email protected]
