Like this question , I am trying to set the first responder to the first of three NSTextField in a very simple application. The advice there (set Window first responder in the interface builder) seems to no longer apply, at least when storyboards are not involved. The Window object does have the initialFirstResponder output, but I cannot find a way to set it using drag, ctrl-drag, etc. In any direction to / from NSTextField.
The IB framework provided me with the Window Controller scheme (an empty window itself) associated with the View Controller scene (which, in turn, contains my set of NSTextField and shortcuts).
My suspicion is that there is some default premise / connection that Xcode baked in my application, which causes the Windows controller to automatically load a certain view at runtime, and therefore it is not possible to link the first responder that it does not know at about build time. Which then leaves me at a loss as to what life cycle is causing, which object is the right point to call self.view.window.initialFirstResponder = myTextField , until it is too late, and how to get access to this object most correctly. viewWillAppear or viewDidLoad in the View Controller is correct, but none of them have a reliable effect (the initially active NSTextField changes from start to start, sometimes appears to track code changes, but never happened).
I already posted the github code
Chris source share