Sau khi nhả các đối tượng tốt nhất là đặt con trỏ thành nil? Đó là những gì tôi đã làm, chỉ muốn hỏi nếu thực hành tốt, cần thiết hoặc quá mức cần thiết của nó?Đặt con trỏ thành 0 sau khi thả?
- (void)dealloc{
[planetName release]; // NSString instance variable
[super dealloc];
}
@end
.
- (void)dealloc{
[planetName release]; // NSString instance variable
planetName = nil;
[super dealloc];
}
@end
cổ vũ -gary-
Bản sao chính xác: Is It Necessary to Set Pointers to nil in Objective-C After release? – James