"Expected expression before" {"token"

There may be something stupid for me. But I've been looking at it all day now and reworking it and what not. I still get the same "Expected expression before" {"token" error.

Before I got this error, I was unable to get my button to do what I asked it to do, which just added two numbers and displayed the response mostly. Here's a bit of code giving me the problem:

-(IBAction)click:(id)sender {   
    int sum = [myInt1.text intValue] + [myInt2.text intValue];
    label.text = {NSString stringWithFormat:@"%@ the answer is %d",
        name.text, sum];
}

      

+2


source to share


1 answer


Replace:

label.text = {NSString ...

      

from:



label.text = [NSString ...

      

(parentheses before NSString).

+16


source







All Articles