我想從目標c文件中調用swift函數。從目標c調用swift函數給出鏈接器錯誤
斯威夫特功能實現:
@objc class FXFormVariables : NSObject {
class func FXFontName() -> String { return fontName }
class func FXFontSize() -> CGFloat { return fontSizeLarge }
class func FXHiddenCell() -> NSArray { return hiddenElementFromFormIndex as NSArray }
}
目標C:
NSArray *hideArray = [FXFormVariables FXHiddenCell];
if ([hideArray containsObject:@(cellIndexPath)]){
return 0.0;
}
鏈接錯誤在構建時:
Undefined symbols for architecture x86_64:
"_OBJC_CLASS_$__TtCC13Social_Engine11AppDelegate15FXFormVariables", referenced from:
objc-class-ref in FXForms.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
此代碼工作正常在Xcode 7.3,但升級後的8.3它開始拋出鏈接器錯誤。
請幫忙。提前致謝。
我已經包含了該文件。 – Akash