NSViewController's viewDidLoad is called before its parent NSWindowController is set

Originator:nimayousefi1
Number:rdar://18565021 Date Originated:06-Oct-2014 09:27 PM
Status:Open Resolved:
Product:OS X Product Version:Xcode Version 6.1 (6A1042b), OS X 10.10 (14A379a)
Classification:Other Bug Reproducible:Always
 
Summary:
In the default Storyboard-based Document-based app template, a the NSViewController's viewDidLoad method executes before the NSWindowController is set on the NSViewController. This means the NSViewController can't access properties of the NSWindowController, or more importantly the NSDocument subclass, in the viewDidLoad method.

viewDidLoad should load after the parent windowController is set.

Steps to Reproduce:
1. Build & run attached project.
2. Create a New Document if one doesn't open automatically.
3. Check the statement logged to the Console

Expected Results:
Within the NSDocument's makeWindowControllers method the NSViewController's window, windowController, and document should be not null. 

Actual Results:
They are null.

Version:
Xcode Version 6.1 (6A1042b), OS X 10.10 (14A379a)

Notes:


Configuration:


Attachments:
'DocumentTest.zip' was successfully uploaded.

Comments


Please note: Reports posted here will not necessarily be seen by Apple. All problems should be submitted at bugreport.apple.com before they are posted here. Please only post information for Radars that you have filed yourself, and please do not include Apple confidential information in your posts. Thank you!