ios - 找不到目标 C 桥接头文件
问题描述
我有一个AppState
使用 swift 类对象的类名
#import "Sonic-Swift.h"
@interface AppState : NSObject
@property (class) NSMutableArray<"Swift class" *> *entity;
现在我需要AppState
在 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'
解决方案
import "Sonic-Swift.h"
应该只在.m
文件中。
如果你想在.h
文件中使用 Swift 类,那么你应该使用
@class MySwiftClass;
推荐阅读
- azure - 如何使用 terraform 启用 azure vm 应用程序洞察监控代理
- powerbi-embedded - power bi rest api的授权令牌用于android应用程序?
- javascript - 从源数字数组中提取随机数的最佳方法是什么,直到源数组中没有唯一值?
- python - 如何获取python中所有文件的大小
- python - 如何从 sqlalchemy 中的方言特定类型获取通用数据类型?
- excel - Excel VBA 解析 XML 字符串按名称和返回属性获取所有节点
- ios - 在 TableView [Swift] 中调用 DidSelect 方法后滚动后重新加载/重用错误的单元格
- algorithm - 算法:淘汰不再有机会赢得比赛的玩家
- elasticsearch - 如何使用偏移+限制> 1000的ES查询
- c - C中的结构指针继承?