Document based printing broken when using storyboards

Originator:owenimholte
Number:rdar://19494505 Date Originated:15-Jan-2015 07:02 PM
Status:Duplicate Resolved:
Product:OS X SDK Product Version:6.1.1 (6A2008a)
Classification:UI/Usability Reproducible:Always
 
Summary:
Document based applications should hook the Print… menu to “printDocument:” but when a document based application is created using a storyboard the Print menu is hooked to “print:” and “printDocument:” must be defined by the user, which is very non-intuitive.

Steps to Reproduce:
1. Start a project in Xcode and choose Cocoa Application.
2. Choose document-based and storyboard (Core Data is indifferent)
3. View Main.storyboard > Main Menu > File > Print… 
4. Look at its Connections inspector
5. See that Sent Actions is hooked up to “print:”

Expected Results:
The print methods on the NSDocument subclass will never get called.

Actual Results:
print: is hijacked somewhere else in the responder chain (still not quite sure where).

Workaround:
1. Choose First Responder in Main.storyboard
2. Choose Attributes Inspector
3. Add a User Defined Action for “printDocument:”
4. Hook the Print menu’s selector up to printDocument.

Now the print methods are called as expected.

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!