[英]In a mixed objc/swift module, Xcode always tries to include the module itself
This one is not easy to explain, but is also very annoying. 这不容易解释,但也很烦人。
I'm working on a Cocoapods framework (in development mode) with objc and swift sources. 我正在使用Cobapods框架(处于开发模式)使用objc和swift源。 Let's call it the " SuperCompoment " framework
我们称之为“ SuperCompoment ”框架
Xcode auto generates the SuperComponent-Swift.h
file, to make Objc classes visible from Swift ones. Xcode自动生成
SuperComponent-Swift.h
文件,以使Objc类从Swift类中可见。
Some Objc classes also includes Swift classes. 一些Objc类还包括Swift类。
At compile time, in the SuperComponent-Swift.h
, Xcode adds the line 在编译时,Xcode在
SuperComponent-Swift.h
添加以下行
#import <SuperComponent/SuperComponent.h>
... and fails to compile with the message: SuperComponent/SuperComponent.h file not found
...并且无法通过以下消息进行编译:
SuperComponent/SuperComponent.h file not found
Xcode tries to include the framework inside the framework itself! Xcode试图将框架包含在框架本身中!
If I manually edit the auto-generated file by commenting the #import, the project compiles perfectly. 如果我通过注释#import手动编辑自动生成的文件,则项目可以完美编译。 But Xcode auto-generates the file after each clean and before archiving the project!
但是Xcode会在每次清理之后和归档项目之前自动生成文件!
Any clue? 有什么线索吗?
我不知道为什么Xcode会自动添加#import <SuperComponent/SuperComponent.h>
行(因为它可以在没有它的情况下工作),但是如果我对他很好,可以在我的根目录添加一个空的SuperComponent.h
文件框架,可以正常编译。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.