mhorgan
mhorgan

Reputation: 886

iOS Framework headers not found in some files of the framework

I am developing a framework for my obj-c iOS app.

I followed this tutorial: https://www.raywenderlich.com/65964/create-a-framework-for-ios

My framework files builds correctly and I can import it into my sample project and it builds correctly. But my project doesn't perform as expected.

When I did deeper into my framework headers, I find my problem.

Certain header files allow me to CMD-Click on the imports to view the corresponding header files in my project.

So for example:

  1. In TestFile.h, I have: #import <Framework/SomeFile.h>, I can CMD-Click on this grand and I get linked to SomeFile.h
  2. In TestFile2.h, I also have: #import <Framework/SomeFile.h>. When I CMD-Click on this, I get the Question Mark symbol indicating that the file isn't found.

In my Framework Project, I have a directory structure like so:

FrameworkProj.xcodeproj
->FrameworkProj
  ->FrameworkHeaders.h
  ->Folder
    ->some files
    ->some folders
  ->Folder

I'm wondering if I haven't set a flag in my Build Settings that doesn't recursively link the files to my compiled framework, but I'm wondering why can I see the files in my headers files if this is the case.

Thanks very much!

Upvotes: 3

Views: 2924

Answers (1)

mhorgan
mhorgan

Reputation: 886

May seem stupid but I solved this problem with a single line.

I needed to include -all_load in Target > Build Settings > Other Linker Flags

Upvotes: 1

Related Questions