【发布时间】:2018-05-24 10:49:28
【问题描述】:
我有一个类名AppState,它正在使用一个快速的类对象
#import "Sonic-Swift.h"
@interface AppState : NSObject
@property (class) NSMutableArray<"Swift class" *> *entity;
现在我需要在 swift 文件中使用这个类 (AppState)。所以我试图在桥接头中导入这个类。
但在导入此文件后,应用程序会在“#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'
【问题讨论】:
-
#import "Sonic-Swift.h" 它应该在 .m 文件中,还有一件事你不需要那个头文件,除非你在你的 AppState 类
-
@PrashantTukadiya 我正在 AppState.h 类中创建 swift 文件对象,这就是我需要导入它的原因。
-
然后试试
@class MySwiftClass;不要在.h中添加头文件 -
谢谢,我试试
标签: ios objective-c swift objc-bridging-header