| |||
| [Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] |
Thanks,
Andre Masse
On Dec 1, 2008, at 23:59, Michael Ash wrote:
On Mon, Dec 1, 2008 at 2:54 PM, Jerry Krinock <email@hidden> wrote:
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];
That document describes the scenario where you destroy your data objects, not where you destroy the data source yourself. The call to setDataSource: is sufficient, as it can no longer query you after that point.
In general, you always need to clear any weak references to your objects when they are deallocated. This is most well known for the weak references you get from NSNotificationCenter, but it applies to other weak references such as delegate and data source references as well. For those you can often get away with not clearing them if they end up getting deallocated at the same time, but as people are discovering here, in some situations you can't count on that.
Mike
_______________________________________________
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
| 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>) | |
| >Re: Crash when closing window from the menu (From: Jerry Krinock <email@hidden>) | |
| >Re: Crash when closing window from the menu (From: "Michael Ash" <email@hidden>) |
| Home | Archives | FAQ | Terms/Conditions | Contact | RSS | Lists | About |
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.