简体   繁体   English

未声明的标识符“ Webview”

[英]Undeclared Identifier 'webview'

I am building a tab bar application with a different pdf in each tab. 我正在建立一个标签栏应用程序,每个标签中都有不同的pdf。 I have two sets of view controllers. 我有两组视图控制器。 Each have this relative code 每个都有这个相对代码

#import "SecondViewController.h"

@interface SecondViewController ()

@end

@implementation SecondViewController

- (void)viewDidLoad
{
    [super viewDidLoad];
    NSString *path = [[NSBundle mainBundle] pathForResource:@"Winter_Newsletter"
                                                     ofType:@"pdf"];
    NSURL *url = [NSURL fileURLWithPath:path];
    NSURLRequest *request = [NSURLRequest requestWithURL:url];
    [webView loadRequest:request];
    [webview setScalesPageToFit:YES];    
}

- (void)didReceiveMemoryWarning
{
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

@end

I keep receiving an error "undeclared identifier 'web view'" What am I doing Wrong? 我一直收到错误消息“未声明的标识符'Web视图'”我在做什么错?

You are showing in the code two versions of webView( capital V ) and webview( small v ) 您在代码中显示了两个版本的webView( 大写V )和webview( 小v

[webView loadRequest:request];
[webview setScalesPageToFit:YES];    

And if you are using auto-synthesize then it sould be 如果您使用的是自动合成功能,

self.webView or _webView self.webView_webView

而且,不要忘记为Web视图添加属性并控制拖动以将其连接起来!

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM