我试图制作一个打开谷歌的网页视图,但我在“[viewWeb loadrequest:myRequest];”行中获得“实例消息不会声明带选择器的方法”错误。错误似乎在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