why wont my UILabel display a NSInteger

前端 未结 6 1711
予麋鹿
予麋鹿 2021-01-26 07:08

I have a ViewController, and GameController class which is just subclassed from NSObject. The view controller has one button linked to it and fires a IBAction that inits a GameC

6条回答
  •  旧巷少年郎
    2021-01-26 07:33

    score is not updated because you are creating new instance of view controller in game controller, you somehow need to pass the object of view controller to game controller and then use the same object to call method setScore.

提交回复
热议问题