当选择可编辑的NSTextField时,Cocoa通过在文本字段周围制作蓝色矩形将其标记为默认值。如何删除NSTextField在编辑完成时选择的指示器
但是,编辑结束后,除非选择了另一个文本字段,否则指示器无法删除。
要删除选择指标,我们应该怎么做?
我们使用以下函数来检测编辑的结束。
override func controlTextDidEndEditing(notification: NSNotification) {
// doing things like getting the string user has been made.
}
即使我想** anotherTextField.becomeFirstResponder()**,** ** textField.resignFirstResponder什么也没有改变。 – Hope
为什么不简单地将窗口的第一响应者设置为取消选择文本字段的'nil'? – vadian