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

awakeAfter(using:)

Overridden by subclasses to substitute another object in place of the object that was decoded and subsequently received this message. サプクラスによってオーバーライドされて、デコードされた後このメッセージを受け取ったオブジェクトに代わって別のオブジェクトが代理を務めるようにされます。

Declaration 宣言

func awakeAfter(using coder: NSCoder) -> Any?

Parameters パラメータ

aDecoder

The decoder used to decode the receiver. レシーバをデコードするために使われるデコーダ。

Return Value 戻り値

The receiver, or another object to take the place of the object that was decoded and subsequently received this message. レシーバ、またはデコードされた後このメッセージを受け取ったオブジェクトに取って代わる別のオブジェクト。

Discussion 解説

You can use this method to eliminate redundant objects created by the coder. For example, if after decoding an object you discover that an equivalent object already exists, you can return the existing object. If a replacement is returned, your overriding method is responsible for releasing the receiver. あなたは、このメソッドを使って、コーダによって作成される冗長なオブジェクトを省くことができます。例えば、あるオブジェクトのデコードの後に同等なオブジェクトが既に存在することをあなたが発見するならば、あなたは既存のオブジェクトを返すことができます。代わりの物を返すならば、あなたのオーバーライドしているメソッドは、そのレシーパをリリースする責任があります。

This method is invoked by NSCoder. NSObject’s implementation simply returns self.

See Also 参照

Archiving アーカイブ

Related Documentation 関連文書