Hello everyone!
I have dragged in IB a “label” on my main window to show the current page of a document, referenced it to the property gCardIDTextField : missing value in my script. Then I tried to update it from code, like:
gCardIDTextField’s setString_(gCurrentCardID as string)
but I get an “unrecognized selector sent to instance” run-time error. What is the correct method?
Before that, I’ve tried to keep my field in sync with my gCurrentCardID code variable, but with what binding? The text field offers to sync the “value” ” does the text field have a value or a title?
I got no problem to set the title of my window by binding, nor to set the text of the main text view with the setString_ method…
a label is technically a NSTextField which uses NSTextFieldCell to implement its user interface.
NSTextFieldCell inherits from NSCell which has the string getter and setter methods stringValue() and setStringValue_(aString)
The value binding affects the content of the text field.
It’s probably called value because NSCell has also setObjectValue, setIntegerValue, setFloatValue etc. methods
I get no error by binding but the text field does not update itself. The binding inspector shows the correct variable (despite a “No completions found” and an exclamation mark on the field)…
Clearly neither the text field nor the text field cell do appreciate my call… any idea? I’m passing an integer to a text field, is that the problem?