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

copy

Returns the object returned by copyWithZone:.

Declaration 宣言

- (id)copy;

Return Value 戻り値

The object returned by the NSCopying protocol method copyWithZone:,.

Discussion 解説

This is a convenience method for classes that adopt the NSCopying protocol. An exception is raised if there is no implementation for copyWithZone:.

NSObject does not itself support the NSCopying protocol. Subclasses must support the protocol and implement the copyWithZone: method. A subclass version of the copyWithZone: method should send the message to super first, to incorporate its implementation, unless the subclass descends directly from NSObject.

See Also 参照

Creating, Copying, and Deallocating Objects オブジェクトの作成、複製、そして割り当て解除