釋放對象後最好是將指針設置爲零?那就是我一直在做的,只是想問一下它的必要,好的做法還是矯枉過正?發佈後設置指針爲零嗎?
- (void)dealloc{
[planetName release]; // NSString instance variable
[super dealloc];
}
@end
。
- (void)dealloc{
[planetName release]; // NSString instance variable
planetName = nil;
[super dealloc];
}
@end
歡呼-gary-
確切副本:Is It Necessary to Set Pointers to nil in Objective-C After release? – James 2009-09-13 22:20:50