Xcode targets prevent .h import

I've inherited some code thatr seems to have undergone a bad refactor.

Instead of separating some code out of BigProject into LittleProject framework and making LittleProject a subproject of BigProject, they did something else:

They made the separated code into a separate Target. Unfortunately, the code associated with that separate Target cannot any longer #import the header files of BigProject. But much of the code in there still needs to use parts of BigProject.

In addition, adding a Header Path into BigProject's header files and making it recursive has no effect. That is how insane this is.

What could cause this inability of code associated with one target to import .h associated with another target? The .m files cannot even see the other target's .h files.

How would I fix this?

Thanks.

Answered by ribose in 723298022

It turns out that A) There actually was a subproject to go along with the new target. B) There was a tiny word "Project" next to the target membership of the header file which needed to be changed to "Public" for the .h to be viewable by code in the main project.

Accepted Answer

It turns out that A) There actually was a subproject to go along with the new target. B) There was a tiny word "Project" next to the target membership of the header file which needed to be changed to "Public" for the .h to be viewable by code in the main project.

Xcode targets prevent .h import
 
 
Q