Rookie Question:
I have my ViewController.m that is getting rather big. What is the way to “off-load” some (general purpose) code to another dot-something file (let’s call it myStuff.m)?
Or to rephrase the question:
- How I call a method from another .m file,
- How I can access a variable and
- How I can access an element (UIView) of another .m file.
Example:
In myStuff.m I want to do the following:
[ViewController ViewController_Method:@"bla"];
yLocal = ViewController.xRemote;
[ViewController.myText setText:@"bla-bla"];
What code do I have to add to my ViewController.m and how should the myStuff.m be set-up to do it?
What is the (easiest) way of doing it?
Variables
Declare public variables
Methods
Declare public methods
Access from another class
Let consider the variables and methods are the part of Class1