Error in Obj-C : Expected identifier or '('

前端 未结 3 1092
迷失自我
迷失自我 2021-01-27 16:23

I\'m trying to make a simple app with a button a score counter and a timer but I\'m getting some errors

    #import 

@interface xyzViewCont         


        
3条回答
  •  傲寒
    傲寒 (楼主)
    2021-01-27 17:05

    You want semicolons inside the function like so:

    - (IBAction)buttonPressed {
    count++;
    scoreLabel.text = [NSString stringWithFormat:@"Score \n %i", count];
    }
    

    This is the correct syntax to use.

提交回复
热议问题