我有一个模型
@interface Section : NSObject
@property (nonatomic, strong) NSString *sectionId;
@property (nonatomic, strong) NSString *title;
+(instancetype)createObject:(NSDictionary *)sectionInfo;
@end
我的桥接头看起来像这样
// MyProj-Bridging-Header.h
#ifndef MyProj_Bridging_Header_h
#define MyProj_Bridging_Header_h
#import "Section.h"
#endif /* MyProj_Bridging_Header_h */
我的 Swift 控制器看起来像这样
@objc class SampleSwiftVC : UIViewController {
var supportedSectionInfo: Section?
}
我开始收到编译时错误,例如
/*PathToProject*/Section.h:17:39: error: expected a type
+(instancetype)createObject:(NSDictionary *)sectionInfo;
^
<unknown>:0: error: failed to import bridging header '/*PathToProject*/MyProj-Bridging-Header.h'