+ alloc
+ allocWithZone:
- init
- copy
copyWithZone:
.+ copyWithZone:
- mutableCopy
mutableCopyWithZone:
where the zone is nil
.+ mutableCopyWithZone:
Availability
Technology
- (void)dealloc;
Subsequent messages to the receiver may generate an error indicating that a message was sent to a deallocated object (provided the deallocated memory hasn’t been reused yet). その後に起こるレシーバへのメッセージは、割り当て解除されたオブジェクトにメッセージが送られたことを指し示すエラーを生成します(割り当て解除されたメモリがまだ再利用されていないという条件で)。
You override this method to dispose of resources other than the object’s instance variables, for example: あなたはこのメソッドをオーバーライドして、オブジェクトのインスタンス変数より他のリソースを片付けるようにします、例えば:
In an implementation of dealloc
, do not invoke the superclass’s implementation. You should try to avoid managing the lifetime of limited resources such as file descriptors using dealloc
.
You never send a dealloc
message directly. Instead, an object’s dealloc
method is invoked by the runtime. See Advanced Memory Management Programming Guide for more details.
When not using ARC, your implementation of dealloc
must invoke the superclass’s implementation as its last instruction.
+ alloc
+ allocWithZone:
- init
- copy
copyWithZone:
.+ copyWithZone:
- mutableCopy
mutableCopyWithZone:
where the zone is nil
.+ mutableCopyWithZone: