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: Jerry Krinock <email@hidden>
- Date: Mon, 1 Dec 2008 11:54:23 -0800
On 2008 Dec, 01, at 6:12, Jean-Daniel Dupas wrote:
- (void)dealloc {
[_tableView setDataSource:nil];
[_otherIVar setDelegate:nil];
According to [1], you need one more line of code here:
[tableView reloadData];
// other dealloc stuff
[super dealloc];
}
Also, note that the behavior causing the crash was changed in Leopard
and is explained some in the Leopard AppKit Release Notes [2].
Let us know if you learn anything interesting, because by following
these recommendations I've got my app to not crash 99% of the time.
Jerry
1. http://developer.apple.com/documentation/Cocoa/Conceptual/OutlineView/Articles/UsingOutlineDataSource.html#/
/apple_ref/doc/uid/20000725. See section "The Data Source and Memory
Management".
2. http://developer.apple.com/releasenotes/Cocoa/AppKit.html#NSTableView
. See section "New Behavior in NSWindowController at Window Closing
Time"
_______________________________________________
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