Posted when the task has stopped execution. This notification can be posted either when the task has exited normally or as a result of
terminate() being sent to the
NSTask object. If the
NSTask object gets released, however, this notification will not get sent, as the port the message would have been sent on was released as part of the task release. The observer method can use
termination to determine why the task died. See Ending an NSTask for an example.
- macOS 10.0+
The notification object is the
NSTask object that was terminated. This notification does not contain a
This notification is posted from the thread in which the
NSTask object called
launch(). When launching a task from a secondary thread or background queue, you can use the
termination property instead for greater control over the execution context of any operations to be performed after the task finishes.