Question

When building an app project with an embedded framework project as a dependency, I added a protocol and builds got errors for

MyProtocol.h file not found

Where could the error be?

Était-ce utile?

La solution

I looked at circular #import dependencies and that was not it. I tried forward declaring the protocol wherever possible. That was not it.

It turns out the gotcha was simply going back to the embedded project Build Phases and making sure to copy the header.

This would apply to any additional class or other header file added.

It is easy to forget this while working on a framework (or other embedded project) inside a project. You can edit and compile changes to existing files, but adding new headers must be copied in Build Phases or they cannot be found.

Spent 30 minutes of my life on this. Hope it helps somebody.

Autres conseils

This could be also caused by missing 'Header Search Paths' in parent project's Build Settings. Make sure that it points to the folder with your header files.

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top