【问题标题】:no visible @iterface CDVViewController没有可见的@iterface CDVViewController
【发布时间】:2016-05-27 13:08:47
【问题描述】:

以下代码给我“No visile @iterface CDVViewController”编译错误:

@implementation MainViewController (CDVViewController)
- (void)webViewDidFinishLoad:(UIWebView*)webView
{
    webView.backgroundColor = [UIColor clearColor];
    webView.opaque = NO;
     return [super webViewDidFinishLoad:webView];
}

@end

当我在为 ios 构建的应用程序中编译 cordova-plugin-camera-preview 时会发生此错误。有任何想法吗?谢谢。

【问题讨论】:

    标签: ios objective-c xcode cordova


    【解决方案1】:

    在您的班级中导入声明

    #import "CDVViewController.h"
    

    【讨论】:

    • 谢谢,但似乎我的 xcode 抱怨找不到 CDVViewController.h 文件。
    • 我不知道cordova,但你的错误说,当前类中没有导入该类
    【解决方案2】:

    要解决 CDVViewController.h 文件未找到问题,请按照以下步骤操作:

    1) 在 Xcode 中选择“TARGETS”。

    2) 转到“构建设置”选项卡。

    3) 搜索“标题搜索路径”

    4) 双击并添加此路径:$(OBJROOT)/UninstalledProducts/$(PLATFORM_NAME)/include

    5) 现在清理项目,重新启动 Xcode。

    6) 能够制作“Build”和“Archive”。

    7) 你可以走了。

    【讨论】:

      【解决方案3】:

      请在 CDVViewController.h 中添加“UIWebViewDelegate”

      @interface CDVViewController : UIViewController <CDVScreenOrientationDelegate,UIWebViewDelegate>
      

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2010-10-27
        • 2021-11-07
        • 2015-05-17
        相关资源
        最近更新 更多