I have an NSAlert item that uses an NSTextField as an accessory item to provide an prompt-like dialog box. The only problem that I have is that when the alert is ran the text field is not focused. I tried looking for a way to change NSAlert's first responder but found nothing. Is there a way to easy focus an accessory item in NSAlert?
            Asked
            
        
        
            Active
            
        
            Viewed 1,952 times
        
    2 Answers
28
            
            
        It seems like you should be able to do something like:
[[alert window] setInitialFirstResponder: myAccessoryView];
before the alert is shown.
        Mel
        
- 959
 - 11
 - 19
 
0
            
            
        You can use [NSWindow makeFirstResponder:] but must make sure to call this after the alert is displayed.
        David Kocher
        
- 632
 - 4
 - 8