I am having a problem finding the length of a text field’s text!
I searched here a lot and just found that it would work with textfield.text.length or something like that.
My problem is textfield.text is not working for me!
If I write this code: textfield.text; then I get an error like this:
property “text” not found on object of type
NSTextField
I have to find the length of an text field in order to limit the number of characters.
What should I do? Thanks in advance.
Most of the classes in AppKit, as opposed to UIKit, don’t have properties.
NSTextFielddoesn’t even have a method calledtext. You need thestringValuemethod, which is inherited fromNSControl