0

我正在尝试创建一个打开 google 的 webview,但在“[viewWeb loadrequest:myRequest];”行上出现“instance msg 未声明带有选择器的方法”错误。错误似乎在 viewWeb 区域,有什么想法吗?

#import "ViewController.h"

@implementation ViewController
@synthesize viewWeb;

- (void)didReceiveMemoryWarning
{
    [super didReceiveMemoryWarning];
    // Release any cached data, images, etc that aren't in use.
}

#pragma mark - View lifecycle

- (void)viewDidLoad
{
    [super viewDidLoad];
    // Do any additional setup after loading the view, typically from a nib.

    NSURL *myURL = [NSURL URLWithString:@"http://www.google.com"];

    NSURLRequest *myRequest = [NSURLRequest requestWithURL:myURL];

    [viewWeb loadrequest:myRequest];
}

- (void)viewDidUnload
{
    [self setViewWeb:nil];
    [super viewDidUnload];
    // Release any retained subviews of the main view.
    // e.g. self.myOutlet = nil;
}

- (void)viewWillAppear:(BOOL)animated
{
    [super viewWillAppear:animated];
}

- (void)viewDidAppear:(BOOL)animated
{
    [super viewDidAppear:animated];
}

- (void)viewWillDisappear:(BOOL)animated
{
    [super viewWillDisappear:animated];
}

- (void)viewDidDisappear:(BOOL)animated
{
    [super viewDidDisappear:animated];
}

- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
{
    // Return YES for supported orientations
    return (interfaceOrientation != UIInterfaceOrientationPortraitUpsideDown);
}

@end
4

0 回答 0