• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Terminating from Separate Thread
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Terminating from Separate Thread


  • Subject: Re: Terminating from Separate Thread
  • From: Chris Suter <email@hidden>
  • Date: Wed, 12 Jul 2006 10:23:21 +1000


On 12/07/2006, at 10:08 AM, Tommy Nordgren wrote:


12 jul 2006 kl. 01.49 skrev Eric Blanpied:

My app has a child object that handles a periodic process on a separate thread. From time to time that process encounters an error which requires notifying the user and quitting the app. So far I've done this with an NSAlert from that thread, and then [NSApp terminate: self], which seems effective.

The trouble is that there are some things that would be good to tidy up in the main thread before even showing that alert. How can I have this child object, on a separate thread, tell the main app to do some stuff, show the dialog (with error data from the child object), & quit?

Thanks,

-e


_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
40chello.se


This email sent to email@hidden
Set a flag in the NSApplication delegate, to signal abnormal termination,
and implement the cleanup in the applicationWillTerminate:
delegate method.

This only works if you can wake up the main thread somehow. It's better to use performSelectorOnMainThread:withObject:waitUntilDone:.



Attachment: smime.p7s
Description: S/MIME cryptographic signature

 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

References: 
 >Terminating from Separate Thread (From: Eric Blanpied <email@hidden>)
 >Re: Terminating from Separate Thread (From: Tommy Nordgren <email@hidden>)

  • Prev by Date: Re: copy vs mutableCopy?
  • Next by Date: Replacing "Cannot open document" dialog in 10.3.
  • Previous by thread: Re: Terminating from Separate Thread
  • Next by thread: Re: Terminating from Separate Thread
  • Index(es):
    • Date
    • Thread