Initializer

init(send:receive:components:)

Initializes a newly allocated NSPortMessage object to send given data on a given port and to receiver replies on another given port. 新しくアロケートされたNSPortMessageオブジェクトを初期化して、与えられたデータをある与えられたポート上で送信します、そしてレシーバは別のポート上で応答します。

Declaration 宣言

init(send sendPort: Port?, 
receive replyPort: Port?, 
components: [Any]?)

Parameters パラメータ

sendPort

The port on which the message is sent. それの上でメッセージが送信されるポート。

receivePort

The port on which replies to the message arrive. それの上でメッセージに対する応答が到着するポート。

components

The data to send in the message. components should contain only NSData and NSPort objects, and the contents of the NSData objects should be in network byte order. メッセージにおいて送られることになるデータ。componentsは、NSDataおよびNSPortオブジェクトのみ含むべきです、そしてNSDataオブジェクトの内容はネットワークバイト順であるべきです。

Return Value 戻り値

An NSPortMessage object initialized to send components on sendPort and to receiver replies on receivePort. あるNSPortMessageオブジェクト、それはcomponentssendPortで送信するようにそしてレシーバがreceivePortで応答するように初期化されます。

Discussion 議論

An NSPortMessage object initialized with this method has a message identifier of 0. このメソッドで初期化されるNSPortMessageオブジェクトは、0のメッセージ識別子を持ちます。

This is the designated initializer for NSPortMessage. これは、NSPortMessageに対する指定イニシャライザです。

See Also 参照

Related Documentation 関連文書