问题描述
我正在尝试通过iOS插件向我的CORDOVA项目添加一个快速框架。但是在插件的.m文件中,我无法从框架访问任何函数。它只是说Use of undeclared identifier
。
以下是我的plugin.xml
<?xml version='1.0' encoding='utf-8'?>
<plugin
id="cordova-plugin-appInvoke"
version="0.1.0"
xmlns="http://apache.org/cordova/ns/plugins/1.0"
xmlns:android="http://schemas.android.com/apk/res/android">
<name>CustomPlugin</name>
<js-module name="CustomPlugin" src="www/CustomPlugin.js"><
clobbers target="cordova.plugins.CustomPlugin" />
</js-module>
<platform name="ios">
<config-file parent="/*" target="config.xml">
<feature name="CustomPlugin"><param name="ios-package" value="CustomPlugin" /></feature>
</config-file>
<source-file src="src/ios/CustomPlugin.m" />
<framework src="src/ios/XYZ.framework" embed="true" custom="true"/>
</platform>
</plugin>
CustomPlugin.m
如下:
#import <Cordova/CDV.h>
#import <XYZ/XYZ.h>
@interface CustomPLugin : CDVPlugin {
// Member variables go here.
}
@property (nonatomic,strong) CDVInvokedUrlCommand *command;
@property (nonatomic,strong) XYZClass *xyzClass;//this is present in the framework,and returning Use of undeclared identifier
// - (void)coolMethod:(CDVInvokedUrlCommand*)command;
@end
@implementation CustomPlugin
@end
我尝试访问的类已经用@objc
标记并且可以被Objective-C访问。
当我将此插件添加到我的cordova项目中并为iOS构建它时,会出现上述错误。
解决方法
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)