Then I would like to use these modes in if-then statements to make different calculations.
Although you can certainly do that, I would strongly advice you against going this route: using the content of a label in calculations runs against the grain of the Model View Controller pattern, because label content is part of a visual representation, while calculations are part of the logical model.
This is more than just a theoretical problem - far from it: using label content prevents localization, and impedes future maintenance of your project.
Here is how to achieve what you are looking for in an MVS way:
- Define a model class that stores the current mode switchable on the button
- Define methods in the model or in the controller that perform calculations based on the current mode
- Define methods to get the current mode and to toggle the mode as necessary
- Make sure the model object is a singleton in your project
- In the view for the "view will appear" method read the mode from the model, and set the label accordingly
- In the code for the button handler, read the current mode, change it as necessary, store back the new value, and update the label accordingly.
This sounds like a lot of work, but the Objective C code for this approach is not much lengthier than the approach that reads from labels directly.
Here is a short example of setting up a model as a singleton in Objective C.