value assigned to a property in the model class disappears in the view/controller class

后端 未结 4 474
心在旅途
心在旅途 2021-01-28 10:13

Right before my model class sends the variable stringToDisplay, NSLog shows me that it has a value. But when I try to use it in my ViewController, I just get

4条回答
  •  一整个雨季
    2021-01-28 11:00

    Oh - your declaration of the property whatHappenedSinceLastClear isn't exposed to other classes that import CalculatorBrain.h because you put the property declaration in an interface extension in the .m file, which other classes will not see.

    To make it publicly accessible move the @property line for whatHappenedSinceLastClear to CalculatorBrain.h, not the .m file.

提交回复
热议问题