Xcode 6.1 has totally new template for document-based apps which use Core Data. Now there's no need to subclass NSWindowController because in 10.10 NSViewController has a lot more power and included in the template as a default view manager. There's even AppDelegate there by default, which is great.
But I'm stuck with very dumb situation. I'm using Core Data. And I can't get currentDocument while app loading! I mean it! All the MVC stack is being called before app did finish launching. I have some objects that needs to be drawn based on Core Data items that has an instance of NSPersinstentDocument. But when ViewController's viewDidLoad gets called, there's no way to get that instance. No way to get currently created/opened document.
- NSDocumentController.sharedDocumentController().currentDocument is nil.
- self.view.window.windowsController.currentDocument is nil.
- NSApplication.sharedApplication().windows[0].windowsController.currentDocument is nil.
What should I do? That's a bug, or I really have to skip code in viewDidLoad and create some method like loadUIStuffNow and call it from applicationDidFinishLaunching of my App Delegate?