On Tue, 10 Feb 2009 13:30:52 -0500, Michael Ash <michael....@gmail.com> said: >Connected it in the nib, then implemented -dealloc: > >- (void)dealloc >{ > [tv setDataSource: nil]; > [super dealloc]; >} > >Crash went away, again exactly as predicted. > >The problem is simply that the one shot setting ends up making the >table view message its data source late in the game, after the data >source has been destroyed. This dangling pointer leads to a crash. >Tying up the dangling pointer by disconnecting the data source fixes >the crash. This is to be expected because, as I discussed, the order >of object destruction is not well defined in this case, so all weak >references need to be disconnected.
Yup, you're right, I'm wrong. My initial discomfort with Seth's explanation was because I felt that the "One Shot" setting shouldn't make this kind of difference. With this dealloc, it doesn't. That's what I was after. Thanks! m. -- matt neuburg, phd = m...@tidbits.com, <http://www.tidbits.com/matt/> A fool + a tool + an autorelease pool = cool! AppleScript: the Definitive Guide - Second Edition! http://www.tidbits.com/matt/default.html#applescriptthings _______________________________________________ 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 arch...@mail-archive.com