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

后端 未结 4 476
心在旅途
心在旅途 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 10:54

    Maybe I'm missing something but your property is declared in the class extension of CalculatorBrain so nobody outside CalculatorBrain.m knows about this property.

    So if you want to expose this property to other objects, you will have to declare it in CalculatorBrain.h instead.

提交回复
热议问题