If the 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 result for this:
NSData* testData = [[NSData alloc] init]; [testData testData];
The output I get is always
#import "NSData+test1.h"
Any explanation on this? Is there a way to force the first category?
The problem is that if you import two SDKs with static libraries that have categories with the same name, how do you deal with the problem. I guess the only way is to ask the SDK creator to use a prefix for the method names?
source share