Why should we set ivars to nil in dealloc?
Why should we set ivars to nil in dealloc?
- Subject: Why should we set ivars to nil in dealloc?
- From: Ferhat Ayaz <email@hidden>
- Date: Sun, 13 Apr 2008 19:48:03 +0200
I see in some Apple's Cocoa examples that ivars are set to nil in the
dealloc method. The auto generated Core Data AppDelegate for new
projects is doing this for each ivar. Here is a simple example:
- (void)dealloc {
[appointments release];
appointments = nil;
[super dealloc];
}
why is it necessary to set the variable appointments (for instance) to
nil in this example? Should we do this for each variable? When have we
to do this?
Thanks,
Ferhat
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden