In my document-based application, I need controllers tied to the document controller to work with documents once they've been opened. Unfortunately, -readFromURL: ofType: error:
fires before these controllers have been initialized and -windowControllerDidLoadNib:
fires before the document has even been opened, meaning that I have no chance to pass the opened document to these controllers. What's a nice clean way of getting around this problem?
Asked
Active
Viewed 74 times
0

John Wells
- 1,139
- 1
- 10
- 27
-
hmmm, might it be possible to show the code that ends up calling "`readFromURL:ofType:error:`"? I want to see if there's a way to call it *after* your window is fully instantiated. – Michael Dautermann Dec 28 '13 at 05:28
-
That method is a standard NSDocument method that is called when opening a document from the standard Open dialog, double-clicking the document in the Finder, or dragging the document onto the application icon. – John Wells Dec 28 '13 at 05:46
-
"`readFromURL:ofType:error:`" is called after you instantiate (create) your custom NSDocument subclass but before the window is loaded/displayed, right? – Michael Dautermann Dec 28 '13 at 06:29