NSDocument recent items menu - doc fails to load
NSDocument recent items menu - doc fails to load
- Subject: NSDocument recent items menu - doc fails to load
- From: Christopher Corbell <email@hidden>
- Date: Sun, 6 Apr 2003 15:03:50 -0700
I'm trying to track down the cause for the following behavior
with NSDocument...
- A window is reused to display various documents. Only one
document is open at a time. (I know that isn't generally the best
UI, but for this app's feature set it's appropriate).
- A document is opened from the "recent documents" window.
The document subclass's initWithContentsOfFile method is invoked
etc., the document data is loaded, and it's associated with the window.
- Something happens (file-new, or opening of another document)
which causes the document to be closed. In closing the document
I make sure that the document is no longer associated with the
window controller for the open window, and also that it's
no longer in NSDocumentController's array of documents.
- (THE BUG) - Choose this document again from the recent
documents window, and it does not get opened, -but- the document's
name and icon do appear in the window's title bar. The
initWithContentsOfFile (or URL) method never gets invoked,
nor does any other method telling my app that a document
is being opened. (A side effect is that the current document
does not therefore get closed, so the actual data in the window
represents the former document, not the one just chosen).
Can anyone tell me what could be happening in this situation?
It seems as though the app still thinks the document is open and
associated with the main window, but this contradicts the
NSDocumentController's state as well as the main window
controller's state.
Is there an NSDocument method I can override that's guaranteed
to be called whenever an open-recent item is selected (or
a doc-controller or app method I can take on as delegate)?
Thanks,
Christopher
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.