How do I force the cursor to the end of a NSTextField?

前端 未结 4 848
梦毁少年i
梦毁少年i 2021-02-19 14:12

I am NSOpenPanel to select a file or folder from a user\'s machine. But when the user clicks \"open\" the cursor is at the beginning of the path that shows up in the text field

4条回答
  •  小鲜肉
    小鲜肉 (楼主)
    2021-02-19 14:37

    In Swift, since it's 2015:

    self.textField.moveToEndOfDocument(nil)
    

提交回复
热议问题