On 2012 Aug 20, at 14:14, Kevin Perry <kpe...@apple.com> wrote:

> Looks like the crash is happening while attempting to invoke 
> -respondsToSelector:.
> 
> Odds are that this is a message being sent to [self delegate], which looks 
> like a deallocated object.

Thank you, Kevin.  I like it.

> Is it possible that the split view is outliving its delegate? Typically, when 
> a delegate gets deallocated (or when you release it for the last time), you 
> are responsible for calling setDelegate:nil on anything that you had 
> previously set it as a delegate for.

Yes.  After restoring from the Versions Browser, the original document and its 
window must be closed and deallocced.  The split view's delegate is the nib's 
FIle's Owner.  It's wired in the nib.  But, because this document can be run in 
a GUI-less tool, the nib File's Owner is the window controller instead of the 
document.  Such a crash is therefore plausible.

I've dealt with such crashes upon window closing previously, and have a 
"tearDown" method in which I remove observers, manual bindings, and delegates.  
So I've just added [splitView setDelegate:nil] to it.
  
On 2012 Aug 20, at 15:41, Lee Ann Rucker <lruc...@vmware.com> wrote:

> I really wish the converse of awakeFromNib was public so we could do our own 
> pre-dealloc nib teardown when we need to.

Yes, that would be nice.  In its absence, I register for 
NSWindowWillCloseNotification, and also override -[NSDocument close], with some 
"only do this once" checking, to run my -tearDown.

Jerry


_______________________________________________

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:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to