why wont my UILabel display a NSInteger

前端 未结 6 1656
予麋鹿
予麋鹿 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:49

    Usually, when the debugger gets information correctly but the UI isn't updating is because the operation to update the UI isn't performed on the main thread. Try this:

    dispatch_async(dispatch_get_main_queue(), ^{ [viewController setScore:score]; });
    

提交回复
热议问题