在Swift桥接头中找不到Objective-C类

时间:2016-02-18 17:53:55

标签: objective-c xcode swift cordova bridging-header

我正在更新我们的Cordova框架,并且我仍然坚持让特定的Objective-C插件类工作。

在我的旧(未更新)项目中,一切正常。我有一个BridgingHeader.h文件,它在构建设置中正确引用。但是在我新的更新项目中,它不再只能找到一个Objective-C类(config.after_initialize do ::Liquid::Template.register_filter(MyApp::Liquid::Filters::UrlParamFilter) end )。

奇怪的是它找到所有其他Objective-C类就好了,它只是它找不到的PushPlugin.m

这是我的BridgingHeader:

PushPlugin.m

当我尝试使用#import <Cordova/CDV.h> #import <objc/runtime.h> #import <Parse/PFObject.h> #import <Parse/PFSubclassing.h> #import <Parse/Parse.h> #import <objc/message.h> #import "GPUImage.h" #import "PushPlugin.h" // This one is not found #import "CDVParsePlugin.h" 时,我找不到错误:

PushPlugin

为了更加确定,//AppDelegate.swift let pushHander:PushPlugin = getCommandInstance("PushPlugin") as! PushPlugin // ERROR: PushPlugin not found 中引用了PushPlugin文件。我的Compile Sources在构建设置中被正确引用。

你知道为什么没有找到一个特定的Objective-C类吗?

更新

所以要明确的是,没有错误报告BridgingHeader文件。只有当我尝试使用PushPlugin时才会遇到错误(意味着它没有正确导入)。

正如所建议的那样,我运行了一个命令行构建,但由于以下原因,构建失败了:

  

**建筑失败**

     

以下构建命令失败:CompileSwift正常arm64   /Users/user/Desktop/mobile-cordova-upgrade/app/platforms/ios/App/Classes/AppDelegate.swift

     

CompileSwiftSources正常arm64 com.apple.xcode.tools.swift.compiler

     

(2次失败)

0 个答案:

没有答案