focus a NSTextField

后端 未结 5 2075
深忆病人
深忆病人 2020-12-08 08:55

I have a NSTextField and I want to set its content if I klick on a button and than set the cursor on this textfield at the end of the text so if someone klicks the button he

5条回答
  •  时光说笑
    2020-12-08 09:20

    You'll want to do something like this:

    [[self window] makeFirstResponder:[self yourTextField]];
    

提交回复
热议问题