Ios 正在尝试实现webview
我正试图创建一个打开google的webview,但在“[viewWeb loadrequest:myRequest];”行上出现了“instance msg未使用选择器声明方法”错误。错误似乎出现在viewWeb区域,有什么想法吗Ios 正在尝试实现webview,ios,iphone,objective-c,Ios,Iphone,Objective C,我正试图创建一个打开google的webview,但在“[viewWeb loadrequest:myRequest];”行上出现了“instance msg未使用选择器声明方法”错误。错误似乎出现在viewWeb区域,有什么想法吗 #import "ViewController.h" @implementation ViewController @synthesize viewWeb; - (void)didReceiveMemoryWarning { [super didRece
#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
您在接口文件中使用过UIWebView委托吗?viewWeb使用的是什么类?UIView还是UIWebView?