-3
我正在使用网络浏览器应用程序,但目前我陷入错误:“预期的标识符或'('',我不知道该怎么办。显示错误:预期标识符或(
{:here is the error
NSURL *url = [NSURL URLWithString:urlString];
NSURLRequest *urlRequest = [NSURLRequest requestWithURL:url];
[self.webView loadRequest:urlRequest];
}
帮助表示赞赏
更新:
我不知道我应该什么其他的代码给你所以这里是在ViewController.m整个代码文件:
#import "ViewController.h"
@interface ViewController()
@property (weak, nonatomic) IBOutlet UIWebView *webView;
@property (weak, nonatomic) IBOutlet UIBarButtonItem *back;
@property (weak, nonatomic) IBOutlet UIBarButtonItem *refresh;
@property (weak, nonatomic) IBOutlet UIBarButtonItem *stop;
@property (weak, nonatomic) IBOutlet UIBarButtonItem *forward;
- (void)loadRequestFromString:(NSString*)urlString;
{ *HERE IS THE ERROR:EXPECTED IDENTIFIER OR '('*
NSURL *url = [NSURL URLWithString:urlString];
NSURLRequest *urlRequest = [NSURLRequest requestWithURL:url];
[self.webView loadRequest:urlRequest];
}
@end
@implementation ViewController ***HERE IS A WARNING SAYING:METHOD DEFINITION FOR 'LOADREQUESTFROMSTRING:'NOT FOUND***
- (void)viewDidLoad
{
[super viewDidLoad];
// Do any `enter code here`additional setup after loading the view, typically from a nib.
[self loadRequestFromString:@"http://www.apple.com/startpage/"];
}
- (void)didReceiveMemoryWarning
{
[super didReceiveMemoryWarning];
// Dispose of any resources that can be recreated.
}
@end
该错误显示在哪里? – Flexicoder
显示更多代码(上下文),因为您发布的代码没有任何问题。 – trojanfoe