I have created a dialog window with an NSTextField and an NSSecureTextField (for a username and password), along with an NSButton to submit. The outlets are properly connected in Interface Builder (non-nil).
I am retrieving the stringValue of the username and password fields in the action handler for the button. However:
The stringValue of the password field (as well as the username field) appear not to update their value while in focus. I have tried the following to correct this issue, to no avail:
I found the solution to my problem. I was disabling the UITextField before asking for its value. For some reason, if I ask for the value before disabling it, the value is correct.
Update: The documentation for the UIControl setEnabled: method states that if its argument is NO, "any editing is aborted."
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With