I am not sure what it is called, but I'd like to create a .m and .h with a few common functions so that i can call them from all of my viewcontrollers.
I have about 5 view controllers.
So here is what i did, which seems not to work.
I create a class and put the function in there:
in the CommonMethods.h
Code:
#import <Foundation/Foundation.h>
@interface CommonMethods : NSObject
-(UIImage*)processImage:(UIImage*)theImage;
@end
In the CommonMethods.m
Code:
#import "CommonMethods.h"
@implementation CommonMethods
-(UIImage*)processImage:(UIImage*)theImage {
// do things here (secret! :P)
//RETURN
return theImage;
}
@end
So in my viewController, i add the import h part in the viewcontroller.m
#import "CommonMethods.h"
then to call, i just use
tmp = [self processImage:myImg];
But got a SIGABRT error.. obviously my vc does not recognize this function..
Please help what is the correct way to do this? Thank you.....