Re: Why should we set ivars to nil in dealloc?
Re: Why should we set ivars to nil in dealloc?
- Subject: Re: Why should we set ivars to nil in dealloc?
- From: "Jonathan del Strother" <email@hidden>
- Date: Sun, 13 Apr 2008 19:00:47 +0100
On Sun, Apr 13, 2008 at 6:48 PM, Ferhat Ayaz <email@hidden> wrote:
> 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?
IMO, it's totally unnecessary. Seems to be a cargo culting thing more
than anything else.
_______________________________________________
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