• 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
Re: Limitations using categories inside libraries ?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Limitations using categories inside libraries ?


  • Subject: Re: Limitations using categories inside libraries ?
  • From: Sailesh <email@hidden>
  • Date: Sun, 6 Apr 2003 17:23:23 -0400

Sorry, I made a typo in my last post.
this line: @implementation NSString (Test_Category)
should be: @implementation NSString (MyCategory)

Note, that was just a typo in my post, not a mistake in the original code. Sorry,
Sailesh

On Sunday, Apr 6, 2003, at 17:08 Canada/Eastern, Sailesh wrote:

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.
_______________________________________________
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.

References: 
 >Limitations using categories inside libraries ? (From: Sailesh <email@hidden>)

  • Prev by Date: Re: custom NSRulerView and other related issues
  • Next by Date: iChat-style table view
  • Previous by thread: Limitations using categories inside libraries ?
  • Next by thread: Re: custom NSRulerView and other related issues
  • Index(es):
    • Date
    • Thread