C
C#•10mo ago
Trapyy

Variables in a class not changing?

I have this IndexSwitcher class: i instantiate this class with the initial value of 0 when i use the switchIndex method, the currentValue variable prints out newIndex like it is supposed to, but when i use the GoToLastIndex, currentIndex always prints out the initial value that is 0, why doesnt it update when i use the SwitchIndex?
No description
2 Replies
Pobiega
Pobiega•10mo ago
Are you sure it's the same instance of the switcher?
Trapyy
TrapyyOP•10mo ago
omg im so dumb 😭 i instantiated it two times thank you

Did you find this page helpful?