代码之家  ›  专栏  ›  技术社区  ›  Parv Bhasker

找不到目标C桥接头文件

  •  1
  • Parv Bhasker  · 技术社区  · 6 年前

    我有个类名 AppState 使用Swift类对象

    #import "Sonic-Swift.h"
    
    @interface AppState : NSObject
    @property (class) NSMutableArray<"Swift class" *> *entity;
    

    现在我要用这个班( 应用程序状态 )在Swift文件中。所以我尝试在桥接头中导入这个类。

    但导入此文件后,应用程序在“import”sonic swift.h“”行“找不到文件”上给出错误。

    failed to emit precompiled header '/Users/krishna_mac_2/Library/Developer/Xcode/DerivedData/Apps-gqelclyzwvyomhcchmjjsejrznaw/Build/Intermediates.noindex/PrecompiledHeaders/Sonic-Bridging-Header-swift_3RJ3MQEOEFTPD-clang_26Q2UBYWMY12Y.pch' for bridging header '/Users/krishna_mac_2/Documents/Documents/Documents/Documents/Documents/Github/Sonic/iOS/Sonic/Sonic-Bridging-Header.h'
    
    1 回复  |  直到 6 年前
        1
  •  3
  •   Eric Aya    6 年前
    import "Sonic-Swift.h" 
    

    应该在里面 .m 仅文件。

    如果你想在 .h 文件,然后您应该使用

    @class MySwiftClass;
    
    推荐文章