Use
[_scoreBox setIntValue:score]
or
[self.scoreBox setIntValue:score]
* Also make sure that you have finished comparing the same button: button==button .
EDIT 2:
How is your code:
int perus(int nappi){ }
Change it to:
- (NSInteger *)perus:(NSInteger *)nappi{
EDIT:
I'm not sure about the following as I found it here
* I would suggest you switch to the obj-c method instead of using the C function for this kind of thing.
The C function is just that the block of code is not attached to anything else. Your instance variable is bound to every controller object. Therefore, when you call printChatter (), there is no way to find out which instance of the controller you want to use. You can add an object variable to your function:
void namedfunction(const void *button, const void *appDele){ NSTextField *myButton=[appDele scoreBox]; .... }
Strike>
source share