2

I am developing a dynamic framework in Objective-C that has public and private headers. Due to some reasons, I do NOT use modular import directives

(e.g: #import <MyFramework/MyPublicHeader.h>)

instead, I use non-modular import directives

(e.g: #import "MyPublicHeader.h")

and I still can build a module so that I can import them from my framework module

(e.g: #import <MyFramework/MyPublicHeader.h>)

So far so good. But, when I import a public header from inside of a private header, I get "header not found" compiler errors.

Example

MyPrivateHeader.h: (compiler error!)

#import "MyPublicHeader.h"

MyPrivateHeader.h: (NO compiler error!)

#import <MyFramework/MyPublicHeader.h>

I checked other projects (for example YAPDatabase) and it imports public headers from its private headers without error. In fact, I already solved the problem for now but I still would like to learn more about the internals of this process. Why do I get "header not found" in this case?

Can anyone illuminate me about the internal mechanism of modules, public headers and private headers?

Mert Buran
  • 2,989
  • 2
  • 22
  • 34
  • Hi Mert, I've run into the same obstacle - have you found out what's going on with this? – moshe Mar 21 '17 at 12:48
  • as i said in the question, if you do `#import ` compiler does compile. yet, i still don't know the real reason of "header not found" problem. hope that helps – Mert Buran Mar 21 '17 at 13:05
  • Same problem here. I will do the same change that guys did. Thanks. (Upvoted) – ricardopereira Oct 19 '17 at 16:13

0 Answers0