简体   繁体   English

无法导入导入Project-Swift.h的Swift桥接头Objective-C文件

[英]Can't import into Swift bridging header Objective-C file that imports Project-Swift.h

I'm trying to #import an Objective-C class to my Project-Bridging-Header.h. 我正在尝试#import一个Objective-C类到我的Project-Bridging-Header.h。 The problem is that the same class has an #import to my "Project-Swift.h" file. 问题是同一个类有一个#import到我的“Project-Swift.h”文件。 So - I'm getting a compilation error. 所以 - 我收到了编译错误。

How can I solve this? 我怎么解决这个问题?

You can do a forward declaration of the enum: 您可以对枚举进行前向声明:

enum myEnum;

But this doesn't get you very much . 但这不会让你受益匪浅 The prevailing wisdom is to define any cross language enums in an Ojective-C context. 流行的智慧是在Ojective-C语境中定义任何跨语言枚举。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM