I am extending a class from a external library. Here is my code:
Header file: Manager+MyCategory.h
#import "Manager.h"
#import "Element.h"
@interface Manager (myCategory)
- (Element*) elementWithTag:(NSInteger)tag;
@end
Implementation file: Manager+MyCategory.h file
@implementation Manager (myCategory)
- (Element*) elementWithTag:(NSInteger)tag {
...
}
@end
Now here is how I use this category:
#import "Manager+MyCategory.h"
@implementation myClass
- (void) myFunction:(NSInteger)tag {
Manager* myManager = [[Manager alloc] init];
Element* = [myManager elementWithTag:tag];
...
[myManager release];
}
@end
When I compile I have no warnings but when I run my program I get the following error:
*** -[Manager elementWithTag:]: unrecognized selector sent to instance 0x105d9a0
*** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '*** -[Manager elementWithTag:]:
Header file (ie Manager+MyCategory.h) is correctly imported but it looks like the link with the implementation file is not done. If I replace #import "Manager+MyCategory**.h**" by #import "Manager+MyCategory**.m**" in my class it's working properly.
Anyone can explain me what I forgot? Thanks