NSDocument init not called in one pane of split view controller in a storyboard

97 Views Asked by At

I have a document-based application that works.

I added an NSSplitViewController, pointed the storyboard entry point to it, moved the document's view controller to a pane in the split view controller, and moved the document's view to one of the split view controller's views. The other split view controller view will contain info that is not part of the document but will serve as a source for info that the user may add to the document.

Everything seems to work fine, except my document's init method is never called. I don't understand enough about the application initialization process with respect to the storyboard to fix this.

Any suggestions?

2

There are 2 best solutions below

1
On

Are you linking your documents view controller in storyboard to a your class?

Link storyboard to class

0
On

In [myTableViewController viewDidLoad] I added an explicit call to [[Document alloc] init] which did the trick.

I still don't know why I did not have to do this in the simpler version, but I have to move on. I've wasted too much time on this as it is.

Thanks for looking at this question.