I followed the instructions in this article to create a static library:
http://developer.apple.com/library/ios/#technotes/iOSStaticLibraries/Articles/creating.html
I built it for iPhone simulator target. It built successfully, then I imported into a new project where I wanted to use it. It imported fine and there are no problems, but the library doesn't work. There are no library methods that I'm calling; rather the purpose of the library is to swizzle the UIViewController viewDidAppear method so that a piece of code gets executed every time a UIViewController appears. This piece of code is not getting called, despite my library being included in the "Link Binary With Libraries" build phase.
I know the problem isn't with the code itself because if I import the raw .m and .h source files not as a library, everything works fine.
Did your library contain any categories?
If so, I think you should follow these steps to get it work:
Please refer to corresponding Apple Documentation
Here is a related question: Objective-C categories in static library
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