2016-11-23 71 views
0

我创建了一个科尔多瓦插件,我对此很新,请纠正我,如果我使用了错误的方法。获取科尔多瓦插件头文件路径

这是我的问题。

里面我的插件,我宣布一个头文件(UNIX可执行文件)将复制到我的Xcode项目,我宣布它像这样我的plugin.xml中,iOS平台

<header-file src="src/ios/lib-cat/cat"/> 

里面现在的我,试图让的路径,我的目标C代码在我的“猫”的文件,我想

NSString *path = [[[NSBundle mainBundle] resourcePath] stringByAppendingPathComponent:@"cat"]; 

我试图

NSString * path = [[NSBundle mainBundle] pathForResource:@"cat" ofType:nil]; 

NSString * path = [[NSBundle mainBundle] pathForResource:@"cat" ofType:@""]; 

NSString * path = [[NSBundle mainBundle] pathForResource:@"cat" ofType:@"exec"]; 

他们似乎都没有工作。任何人都可以为我提供正确的路径吗?

回答

0

回答我的问题,

我改变

<header-file src="src/ios/lib-cat/cat"/> 

<resource-file src="src/ios/lib-cat/cat"/> 

NSString *path = [[[NSBundle mainBundle] resourcePath] stringByAppendingPathComponent:@"cat"]; 
搜吧