I know i have done this before, but I just cant remember how to do it.
I have a integer, that i want to be able to change in another class of mine.
how do i
In your example, int score is an instance variable, or ivar for short. It's a piece of data associated with any given instance of MainViewClass. By default, and for good reason, instance variables have @protected visibility, meaning that only MainViewClass and its subclasses can access it.
Now, you made OtherClass a subclass of MainViewClass in your example, which means to access score from the same object you need only type score or self->score, and from another object that is a MainViewClass you need only type theOtherObject->score. (This sort of design exposes implementation details and so is often considered to be bad design by many coders, but for a simple use case like this you can probably get away with it. Why it's bad is a discussion that has raged for decades and is beyond the scope of this question.)