Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Crash when closing window from the menu



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:
http://lists.apple.com/mailman/options/cocoa-dev/email@hidden

This email sent to email@hidden
References: 
 >Crash when closing window from the menu (From: Andre Masse <email@hidden>)
 >Re: Crash when closing window from the menu (From: Jean-Daniel Dupas <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.