【问题标题】:Cordova Xcode Build errors with cordova 2.3.0科尔多瓦 Xcode 使用科尔多瓦 2.3.0 构建错误
【发布时间】:2013-01-30 09:32:15
【问题描述】:

将 Xcode 项目从 Cordova 2.2.0 升级到 2.3.0 构建失败:3 个错误“MainCommandDelegate”不能使用“super”,因为它是根类”

  • (id)getCommandInstance:(NSString*)className { return [super getCommandInstance:className]; }
  • (BOOL)execute:(CDVInvokedUrlCommand*)command { return [super execute:command]; }
  • (NSString*)pathForResource:(NSString*)resourcepath; { return [super pathForResource:resourcepath]; }

和 1 个错误:''MainCommandQueue' 不能使用 'super',因为它是根类' - (BOOL)execute:(CDVInvokedUrlCommand*)command { return [super execute:command]; }

请帮忙! 非常感谢

【问题讨论】:

    标签: cordova xcode4.5 phonegap-plugins phonegap-build


    【解决方案1】:

    问题已解决:

    我们将新的 MainViewController.m 移到了我们的项目中。另外我们要声明这些接口并导入相关的头文件:

    #import <Cordova/CDVViewController.h>
    #import <Cordova/CDVCommandDelegateImpl.h>
    #import <Cordova/CDVCommandQueue.h>
    
    @interface MainViewController : CDVViewController
    @end
    
    @interface MainCommandDelegate : CDVCommandDelegateImpl
    @end
    
    @interface MainCommandQueue : CDVCommandQueue
    @end
    

    【讨论】:

    • 我也有同样的问题。你用上面的导入和声明接口更新了什么文件?我尝试将它们更新到 MainviewController.h 但我收到有关“/Users/wug/Projs/Learning/hello_cordova2/ios/hello_cordova2/Classes/MainViewController.h:30: Cordova/CDVCommandDelegateImpl.h: No such file or directory”的编译错误
    • 我遇到了和你@GeorgeW 一样的问题 - 你设法解决了吗?
    • 在项目中 |目标 |构建阶段 |链接或链接器库;确保添加 libCordova.a 或类似的东西。祝你好运。
    • Wonderful 在这个问题上卡了一个小时,你的解决方案解决了我的问题,谢谢!! Dream1,我在 2.6.0 上解决了
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2023-03-23
    • 1970-01-01
    相关资源
    最近更新 更多