here's a quick question, I have a couple of class controller classes and there are other classes. I found myself creating some methods in all of my implementation files that do the same.
I would like to write some of my methods in a separate file, and import this file into my view controllers. so I can run these methods from my current view controller,
If this method requires a change, I will not need to overwrite it in all my implementation files.
Let me wipe only one thing. I do not want to create a new object! and create an instance. I really want to be able to run this method the same way I did: [self doSomething];
Please help to understand how this should be done.
i.e. I have 3 view controllers, each of which has the following method:
-(void)doSomething:(id)sender{
}
I just want this doSomething method to be defined in one place, and I could access it from my view managers by running: [self doSomething];
Is it possible?
Thanks in advance.
source
share