Re: NSDocument: messages sent to closed document
Re: NSDocument: messages sent to closed document
- Subject: Re: NSDocument: messages sent to closed document
- From: Jerry Krinock <email@hidden>
- Date: Sat, 17 Jan 2009 18:39:51 -0800
On 2009 Jan 17, at 6:09, Cate Tony wrote:
1. Open one document.
2. Open a second document.
3. Close the second document
4. Click on the File or Help menu
Crash: message sent to dealloc instance of NSDocument.
Here's an interesting twist.
1. Open one document.
2. ...
Everything is fine.
Don't assume everything is fine just because it hasn't crashed (yet).
I would ignore this twist and concentrate on the crash.
When I check the documents in NSDocumentController, I see that the
correct document is being removed in both cases.
I'm out of ideas on this one. I'd appreciate any help you can offer
on puzzling this out.
You need to insert a tattletale in the sequence leading to the crash.
Temporarily insert a few [self retain] statements somewhere in your
document's code that's guaranteed to run, so that your document will
not be deallocced. Then Build and Debug. Do your 1-3, then place a
breakpoint at the beginning of the method that gets the message that
causes the crash. Then do step 4. Execution should stop at your
breakpoint. Look at the stack trace in the Debugger window to find
out who called.
_______________________________________________
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