As far as I know, base64EncodingWithLineLength is a method that is not defined in NSData , but in a category called NSData+Base64.h . The reason you get the error message is because you did not add this category to your project, so the method is called, it was not found.
Therefore, you must add the "NSData + Base64. *" Files to your project. Get them from here .
EDIT:
Since the OP mentions that the category is included in the static library and it is assumed that the static library is correctly linked, a possible solution to this problem is to add
-ObjC
check the "Other linker flags" checkbox in the build settings. This flag will force all characters in the Objective-C category to be loaded, preventing them from being optimized through the linker.
source share