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

后端 未结 4 515
心在旅途
心在旅途 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:56

    It really depends how you set stringForDisplay inside the performOperation:withArray: method.

    for a blind guess, try using

    NSString *otherString = self.brain.stringForDisplay;
    

    after this line

    double result = [self.brain performOperation:operation withArray:[self.brain whatHappenedSinceLastClear]];
    

提交回复
热议问题