Question

I'm building a Static iOS Framework with the templates from jverkoey/iOS-Framework, and in the framework I include the source files for MKNetworkKit.

I added the #import "MKNetworkKit.h" and everything seems to be working fine inside Xcode. The project builds and category methods are found by the code completion.

But when the code runs I find that whenever a method is called on a category, such as - [NSString md5], the application crashes with an error such as: -[__NSCFString md5]: unrecognized selector sent to instance 0x71cab20.

I can reproduce the issue by including the category in another file and try to call any method on the category. In the code editor it looks fine, it builds fine, but then it blows up when running.

I'm building for iOS 6 and running the framework as a dependency for an iOS application project. All code that uses the categories are inside the framework.

Was it helpful?

Solution

Right after I posted I found the solution here.

What you need to do is add the linker flag -all_load to your main project's Build Settings.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top