OK, I'm trying to create a Cocoa Library (static) and use, but I keep getting errors.
I created a super-basic static Library (TSXLib) with just one additional class in it.
#import <Foundation/Foundation.h>
@interface ClassOne : NSObject
- (void)doIt;
@end
#import "ClassOne.h"
@implementation ClassOne
- (void)doIt
{
NSLog(@"Oops... I did it again!");
}
@end
Then, I set the Dynamic Library Install Name (in Build Settings) to :
@executable_path/../Frameworks/libTSXLib.a
Now in my Test Project :
libTSXLib.a file (and copied it to target)libTSXLib.a to FrameworksAppDelegate.m and try importing my library's class#import <ClassOne.h>, the compiler throws an error that it can't find the classAny ideas?
NOTE : I'm actually quite confused regarding libraries, frameworks, etc (that's why I tend to avoid them as much as possible). All I'm trying to do is pack some of classes/functions so that I can easily re-use them in different projects. Whether it is a framework, or a library, I really don't care. What I need is that : pack and re-use my code. (the ability to block anyone from seeing/using what's in, when bundled, would be a Plus)
OK, so, coming back after some time, here's what I did to get it working :
.a file origin (using recursion (like /the/path/to/your/library/folder/**)YES-ObjC to Other Linker Flags, under Build Settings.If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With