Occationaly I see snippets of code creating new methods for objects and such that looks like this:
@implementation UIImage (Extras)
- (void)aMethod:(id)anObject {
// some functionality
}
@end
Where do I put this code? Do I put it in the class I’m currently writing code for? If so at what point in the code do I need to put this?
Thank you.
You can put this category code whereever you like. In general, this code should be in a file called UIImage+Extras.m and a matching header file UIImage+Extras.h.