【问题标题】:No visible @interface 'UIView' declares the selector 'loadRequest'没有可见的@interface 'UIView' 声明选择器 'loadRequest'
【发布时间】:2013-11-27 10:15:51
【问题描述】:

我正在按照this 教程创建一个 webView 应用程序。我完全按照所有步骤操作,但出现此错误:

No visible @interface 'UIView' declares the selector 'loadRequest'

-

- (void)viewDidLoad
{
   [super viewDidLoad];

   NSString *fullURL = @"http://google.com/";
   NSURL *url = [NSURL URLWithString:fullURL];
   NSURLRequest *requestObj = [NSURLRequest requestWithURL:url];

    [_viewWeb loadRequest:requestObj];

   // Do any additional setup after loading the view, typically from a nib.
}

我该如何解决?

【问题讨论】:

  • 你把_viewWeb当作UIView对象了吗???请检查一下我的朋友..你将不得不创建 UIWebview 的对象。
  • 在第 15 步中,您应该确认 viewWeb 是 UIWebView 而不是 UIView
  • 显示您的 _viewWeb 声明部分

标签: ios iphone objective-c uiview uiwebview


【解决方案1】:

正如@NiravPatel 所提到的,@Chancy。我在第 15 步中犯了这个错误。

我正在使用

 @property (strong, nonatomic) IBOutlet UIView *viewWeb;

而不是

 @property (strong, nonatomic) IBOutlet UIWebView *viewWeb;

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2012-10-28
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2020-07-27
    相关资源
    最近更新 更多