简体   繁体   English

在头文件中找不到桥接头

[英]Bridging header not found in header file

I have this annoying error that stops me from developing some features in my app.我有这个烦人的错误,阻止我在我的应用程序中开发一些功能。 Here is the thing:这是事情:

  • I developed a swift/objc project我开发了一个 swift/objc 项目
  • The bridging header works every where in my project桥接头在我的项目中的每个地方都有效
  • I import it in .m files and this works !我将它导入到 .m 文件中,这有效!

Now I have this file EventCell.h:现在我有了这个文件 EventCell.h:

  • I import the bridging header in it : no problem我在其中导入桥接头:没问题

From another file CalendarView.h:从另一个文件 CalendarView.h:

  • I import EventCell.h in it我在其中导入 EventCell.h

And boom和繁荣在此处输入图片说明

I can't get this issue !我不能得到这个问题! Please help me :)请帮我 :)

You cannot import the bridging header into a .h file.您不能将桥接头导入 .h 文件。 You should use forward declarations if you need access to a Swift class.如果您需要访问 Swift 类,您应该使用前向声明。

Use @class MyClassName, or @protocol MyProtocolName使用@class MyClassName, or @protocol MyProtocolName

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

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