Skip to main content
Tuna Bicim
Associate II
April 16, 2020
Solved

Unexpected changes on variables stored in model class.

  • April 16, 2020
  • 2 replies
  • 1710 views

Hello Everyone,

I am storing some variables in the model and access them from different screens. When the values are initialized they have the correct value however after a while they get random values that are outside the ranges that I store in them. I use a member function on both presenter to get the value from a get function on model. The corrupted values are quite large which makes me suspect the values get overwritten with different data.

I also setup breakpoints on the tick function inside model and the values are fine but it might be something else that makes the change after a while or on a screen change.

0693W000000VxNQQA0.png

This topic has been closed for replies.
Best answer by Tuna Bicim

I figured out the problem. I was calling the function from the presenter on my view file on the constructor. When I moved the code after the setup screen it worked fine. I was probably trying read from an uninitialized or not updated presenter pointer.

2 replies

Tuna Bicim
Tuna BicimAuthorBest answer
Associate II
April 16, 2020

I figured out the problem. I was calling the function from the presenter on my view file on the constructor. When I moved the code after the setup screen it worked fine. I was probably trying read from an uninitialized or not updated presenter pointer.

Martin KJELDSEN
Principal III
April 16, 2020

Glad you solved it ! :)