0

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.

4
  • Hi. Add a folder with headers in the BuildSettings->Search Paths->UserHeaderSearchPaths. E.g. in the my project it's looks like $(SRCROOT)/libs/**. Commented Aug 5, 2015 at 21:48
  • but these are not public headers, these are files that are being used in the rest of the library, but not publicly visible. there are multiple folders that holding files used in the library. Will that still work or? and how to reference them, when i am creating the library so i provide the library to clients, so they can not see the source. Commented Aug 5, 2015 at 22:00
  • anyone knows how can i check all the folders and files included in the library? i mean i have access to the Xcode project, but i can not really figure out whether all the files are there or not. Commented Aug 5, 2015 at 22:48
  • I excluding the folder with sources from xcode project (without deleting from a disk). Then I re-adding in the project, need to check the right target when adding. All sources will be added to target. Commented Aug 6, 2015 at 8:13

1 Answer 1

0

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.

Sign up to request clarification or add additional context in comments.

1 Comment

i have already created the framework instead of static library, but once all of the headers that can not be found, put as public, the app including the framework compiles, but now i am having an issue with the using one of the view controllers from inside the framework, in the app, once i try and use it, shows lot of match errors.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.