-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