I am using Objective-C in my app and I have a question about multiple inheritance in @interface declarations.
Pretty much this is what my .h looks like now:
#import "cocos2d.h"
@interface UIViewController (Save)
- (void)saveImage:(UIImage*)image:(NSString*)imageName;
- (void)removeImage:(NSString*)fileName;
- (UIImage*)loadImage:(NSString*)imageName;
@end
@interface CCLayer (Save)
- (UIImage*)loadImage:(NSString*)imageName;
- (BOOL)checkExists:(NSString*)thePath;
@end
So as you can see, I have declared the loadImage method twice. I do not want to do this. This also means I have to have the same code in my .m twice for that method.
Is there any way to mix the UIViewController and CCLayer into 1 @interface so that I do not have to declare it multiple times?
Thanks!
SEL
in the same class.loadImage:
) in the @interface
which declared adoption. you can also declare it in a dummy category, then define loadImage:
in another @implementation
scope.@interface
may be logically subdivided.