Re: NSDocument subclass can only be opened once
Re: NSDocument subclass can only be opened once
- Subject: Re: NSDocument subclass can only be opened once
- From: Graham Cox <email@hidden>
- Date: Thu, 23 Jan 2014 22:25:34 +1100
On 23 Jan 2014, at 10:11 pm, SevenBits <email@hidden> wrote:
> No, it doesn't. That's the crux of the issue.
Yes, that's what I've been trying to tell you. You've shown code relating to opening the document, nothing on how it gets closed. That's my point - it's that part that's broken, so that's where you need to focus your attention.
Did you use the standard XCode project template for a document-based application? If so, it's set up to work without too much need for understanding on your part, but if you are setting it up manually, there are a few things you need to know about how NSDocument., NSDocumentController, NSWindow and NSWindowController all interact. For example, the window controller needs to know about its document - you use -setDocument: to make that association. If you didn't, the document won't be notified when the controller's window closes. There are also various delegate methods involved in closure, and some other methods invoked directly by the window controller. Look there.
--Graham
_______________________________________________
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