Search code examples
iosios-library

iOS static library issue with referencing files


I am having an issue, created iOS App and convert it to Static Library. The problem i am facing is that when i build the static library it compiles and builds without any issues.

When i try to use the library in another app, when i reference the public header, it can not find the referenced file in it.

Here is a screenshot

enter image description here

The file is there, when i try to access it, it opens up. And the file is in the folder as well so don't know why it is not found.

when i add the library project so i can easy access it in the app project, in one of the folders it shows the file there. the folders go like library_folder/include/DMSDelegateProtocol.h

Thank you in advance for the help.


Solution

  • Read this https://developer.apple.com/library/ios/technotes/iOSStaticLibraries/Articles/creating.html.

    You should configure the Headers phase (tab Build Phases) for your static lib target. The lib must be distributed with the headers. Also you can look at frameworks instead static lib.