NSButton GET title issue

Hi everyone,

I have the following NSButton and I can set its title programmatically like this:

myButton's setTitle:"Processing"

The problem arise when I try to get its value (The title’s string);

[format]myButton’s getTitle[/format]
Can’t get getTitle of «class ocid» id «data optr00000000F084620001000000». (error -1728)

I’ve tried this code as well but it yields just a different error message:

[format]myButton’s getTitle()[/format]
[NSButton getTitle]: unrecognized selector sent to instance 0x103c4b6b0 (error -10000)

Obviously there is a key concept that I’m missing here but I’m not able to find the solution…



The key concept is that the getter is the method without set – actually the setter is the method with set prefix and lowerCamelCased.

And if you want to use the result in AppleScript you have to coerce it to an AppleScript type

myButton's title() as text

It’s always worth it to have a look at the documentation

Exactly what I was looking for.

Thank you for point me out in the right direction and your quick response.