• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Limitations using categories inside libraries ?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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.

  • Follow-Ups:
    • Re: Limitations using categories inside libraries ?
      • From: Sailesh <email@hidden>
  • Prev by Date: Re: StripedTableView and sheets
  • Next by Date: Re: custom NSRulerView and other related issues
  • Previous by thread: Re: StripedTableView and sheets
  • Next by thread: Re: Limitations using categories inside libraries ?
  • Index(es):
    • Date
    • Thread