4E109: UIViewController template's loadView stub obfuscates storyboards

Originator:matt
Number:rdar://10956611 Date Originated:2/29/2012
Status:Open Resolved:
Product:Developer Tools Product Version:4.3 (4E109)
Classification:Serious Bug Reproducible:
 
Summary:
The new UIViewController subclass file template includes an empty loadView method, which obfuscates any Storyboard work that's been associated with that class. The view controller has no view as a result and the developer is left to wonder why his project is broken.

Steps to Reproduce:
1) Create a new storyboard-based Single-View project
2) Create a new UIViewController subclass file (name it "CustomViewController")
3) Open the storyboard, and add a label and a button to the initial view controller
4) From the storyboard, set the VC's Identity > Custom Class to CustomViewController
5) Run 

Expected Results:
Expect to see my button and label

Actual Results:
See a black screen, and "Applications are expected to have a root view controller at the end of application launch" in the Debug area

Regression:
4.3 (4E109). Did not occur in < 4.3

Notes:
If you check "With XIB for user interface" then there is no loadView method in the resulting source file. The assumption here is that if you're not using a XIB, then you must be going code-only. But that is entirely untrue with storyboards: I'll be creating tons of XIB-less classes now, while still constructing my hierarchies in IB.

It doesn't help anyone to include loadView uncommented. It only confuses people who are trying to use Apple's newest recommended technologies. Anyone completely opting out of IB presumably understands that they'll need their own loadView method, and doesn't need a lot of help. Leaving it commented out with appropriate instructions in said comments is still friendly to less-experienced devs without overtly pulling the rug out from everyone else.

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!