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 (Cocoa-dev@lists.apple.com)

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/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]

Reply via email to