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.

Borce Ivanovski
  • 561
  • 1
  • 4
  • 23
  • Hi. Add a folder with headers in the `BuildSettings->Search Paths->UserHeaderSearchPaths`. E.g. in the my project it's looks like `$(SRCROOT)/libs/**`. – Serge Maslyakov Aug 05 '15 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. – Borce Ivanovski Aug 05 '15 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. – Borce Ivanovski Aug 05 '15 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. – Serge Maslyakov Aug 06 '15 at 08:13

1 Answers1

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.

Serge Maslyakov
  • 1,410
  • 1
  • 17
  • 23
  • 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. – Borce Ivanovski Aug 06 '15 at 21:32