Instance Method インスタンスメソッド

disableAutomaticTermination(_:)

Disables automatic termination for the application. アプリケーションに自動終了を利用不可能にします。

Declaration 宣言

func disableAutomaticTermination(_ reason: String)

Parameters パラメータ

reason

The reason why automatic termination is being disabled. なぜ自動終了が利用不能にされているかの理由。

Discussion 議論

This method increments the automatic termination counter. When the counter is greater than 0, the application is considered active and ineligible for automatic termination. For example, you could disable automatic termination when the user of an instant messaging application signs on, because the application requires a background connection to be maintained even if the application is otherwise inactive. このメソッドは、自動終了カウンタを漸増します。カウンタが0より大きい場合、アプリケーションは活動中でそして自動終了に対して適格でないとみなされます。例えば、あなたはインスタンスメッセージアプリケーションの利用者が署名入室する場合に自動終了を利用不可能に出来ます、なぜならアプリケーションはあるバックグラウンド接続を要請して保守されるからです、たとえアプリケーションがそれ以外では活動していないとしても。

The reason parameter is used to track why an application is or is not automatically terminable and can be inspected by debugging tools. For example, you could pass the string @"file transfer in progress" if you disable automatic termination before transferring a file over the network. When you reenable automatic termination after the transfer is complete using enableAutomaticTermination(_:), you should pass the matching string. A given reason can be used more than once at the same time; for example, if two files were being transferred at the same time, automatic termination could be disabled for each, passing the same reason string. reasonパラメータは、あるアプリケーションが自動終了可能であるまたはでない理由を追跡するために使われます、そしてデバッグツールによって調査されることが可能です。例えば、あなたは文字列@"file transfer in progress"を渡すことができます、もしあなたがファイルをネットワーク越しに転送する前に自動終了を作動しないようにするならば。あなたが自動終了をその転送が完了した後にenableAutomaticTermination(_:)を使って再度利用可能にする場合、あなたは調和する文字列を渡すべきです。与えられた理由は、一度に一度以上使用できます;例えば、2つのファイルが一度に転送していたならば、自動終了はそれぞれに対して、同じ理由文字列を渡して利用できなくされることが可能です。

See Also 参照

Controlling Automatic Termination 自動終了を制御する