Re: Crash when closing window from the menu
Re: Crash when closing window from the menu
- Subject: Re: Crash when closing window from the menu
- From: Andre Masse <email@hidden>
- Date: Mon, 01 Dec 2008 09:21:01 -0500
Ah! Didn't know that.
Thanks a lot,
Andre Masse
On Dec 1, 2008, at 09:12, Jean-Daniel Dupas wrote:
When you dealloc a datasource, a delegate or any other object that
is not retained by class that uses it, you have to unregister it.
For example, if you have an object that is datasource for its
_tableView ivar and delegate for _otherIVar ivar, you should do
something like this :
- (void)dealloc {
[_tableView setDataSource:nil];
[_otherIVar setDelegate:nil];
// other dealloc stuff
[super dealloc];
}
You should also remove it from notification center if it is
registered as observer, etc.
Not that all this stuff is useless in Garbage collected app, and
should not be duplicate in finalize.
_______________________________________________
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