Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

nstextfield securetextentry

I am making a login page, when I get user input its fine. The credentials are going to be stored in a file. The values stored in file get set as the string of the NSTextField. If I use NSSecureTextField the password is never seen by user when I read the values from my file. I searched but was unable to view the password in my UI. I want to know if there is any way to make the password visible in my NSSecureTextField. I just tried it with NSTextField but then the user can see passwords being entered.

like image 869
Dhiraj Avatar asked Feb 18 '23 00:02

Dhiraj


1 Answers

As this comment says if you would just like to set the value of an NSSecureTextField just use setStringValue: on it. If you would like to be able to read what is in the NSSecureTextField you can call setEchosBullets: and pass false to make it show the actual text.

like image 110
Keith Smiley Avatar answered Feb 26 '23 17:02

Keith Smiley