Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/iphone/40.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Ios 正在尝试实现webview_Ios_Iphone_Objective C - Fatal编程技术网

Ios 正在尝试实现webview

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

我正试图创建一个打开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

您在接口文件中使用过UIWebView委托吗?viewWeb使用的是什么类?UIView还是UIWebView?