Limitations using categories inside libraries ?
Limitations using categories inside libraries ?
- Subject: Limitations using categories inside libraries ?
- From: Sailesh <email@hidden>
- Date: Sun, 6 Apr 2003 17:08:18 -0400
Here's the code that I'm using (also at
http://sailesha.com/code.tar.gz
) :
~/Test.app
main.m
...
void foo();
void main() {
...
foo();
...
}
~/libTest.a
MyCategory.h
...
@interface NSString (MyCategory)
- (void) doTestPrint;
@end
MyCategory.m
...
@implementation NSString (Test_Category)
- (void) doTestPrint {
NSLog(self);
}
@end
Foo.m
#import "MyCategory.h"
void foo() {
NSString *s = @"google";
[s doTestPrint];
}
Now, I build libTest.a as a static library and drop it into Test.app's
project. Everything builds fine but when I run it I get an exception,
"-[NSCFString doTestPrint]: selector not recognized". Cases where this
works:
- if in main.m I import MyCategory.h
- if I move foo() from Foo.m to MyCategory.m
- if I make libTest.a into a framework use it that way
Is this a known limitation of static libraries ?? Are there any work
arounds ??
thanks for you time,
Sailesh
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.