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?

有帮助吗?

解决方案

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.

其他提示

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.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top