NSWindowController should have access to root view controller
| Originator: | juri.pakaste | ||
| Number: | rdar://19364121 | Date Originated: | 01-Jan-2015 02:12 PM |
| Status: | Open | Resolved: | |
| Product: | OS X SDK | Product Version: | 10.10 |
| Classification: | Enhancement | Reproducible: | Always |
Summary: There is no way to access the NSViewController responsible for the root view of a window from the window’s NSWindowController. Steps to Reproduce: 1. Open the API docs 2. Discover there is no way to access the view controller Expected Results: I expected to find a method analogous to rootViewController on UIWindow in UIKit. Actual Results: No way to do it. Notes: This can be worked around by calling self.view.window!.windowController()! in the NSViewController’s viewWillAppear (can’t use viewDidLoad, see rdar://18565021) and setting a property on the window controller. But this is a deeply unsatisfying hack and we shouldn’t have to bend over backwards to do this.
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!