If an XCode project has two categories :
@implementation NSData (test1)
- (void) testData {
NSLog(@"test data 1");
}
@end
and
@implementation NSData (test2)
- (void) testData {
NSLog(@"test data 2");
}
@end
What is the expected output for this :
NSData* testData = [[NSData alloc] init];
[testData testData];
The output I am getting is always
#import "NSData+test1.h"
Any explanations on this? Is there a way to force the first category?
The problem here is that if you are importing two SDK's with static libraries that have categories with the same name, how do you get around the problem. I'm assuming the only way is to ask the SDK creator's to use a prefix for the method names?