Mac

1.在设置用户登录信息的时候,需要设置点击登录按钮的时候,NSTextField光标失去焦点。

1  //设置 textfield的  失去光标
2     [self.userPasswordText.window makeFirstResponder:nil];

参考链接:

 http://pinkstone.co.uk/how-to-remove-focus-from-an-nstextfield/

 

2. 默认选中NSTextField 的时候会出现蓝色边框如下图:想要去掉边框的话设置如下:

[self.userNameText setFocusRingType:NSFocusRingTypeNone];

3.

NSTextField修改内容

 textField.stringValue = "内容"

原文地址:https://www.cnblogs.com/741162830qq/p/5082434.html