Working with NSTextFields
Working with NSTextFields
- Subject: Working with NSTextFields
- From: Alex Hall <email@hidden>
- Date: Tue, 15 Sep 2015 12:11:54 -0400
Hello list,
I have an NSTextField, and I can get/set its value by its stringValue property. However…
* When I call myField.stringValue="some text", that string ("some text") appears as expected, but it's highlighted. That means that, when the user starts typing, it disappears, defeating the purpose of the app putting it there for the user in the first place. I want to leave the field able to support selecting text, but I don't want new text programmatically inserted to be selected automatically.
* If I try to set any properties of the field itself, I can't, because "self is immutable". For example, in my text field delegate, I have controlTextDidChange implemented. It works, but I wanted to update the field's accessibilityHelp property in there. When I do
myField.accessibilityHelp="new a11y help"
I get the error "cannot assign to property: 'self' is immutable". My outlet is a var, not a let, but I don't think this error is referring to that anyway.
* My field currently doesn't allow spellchecking or auto-correct, but I want it to. I don't see that option anywhere in the inspectors, for the field or its child cell. I don't want rich text, just spellchecking. Is it hiding somewhere, or is this done programmatically?
As always, thank you for your time and help.
--
Have a great day,
Alex Hall
email@hidden
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden