在 .m 文件中添加一些 labelLoading 代码时,我在 Xcode 中遇到错误。希望有人可以帮助我并指出代码中的错误。不要在我学习的时候把我打得太惨。我只是无法克服这个错误。
@interface ViewController ()
@end
@implementation ViewController
@synthesize viewWeb;
@synthesize labelLoading;
@synthesize tqwWeb;
@synthesize blogWeb;
@synthesize eventsWeb;
@synthesize resWeb;
@synthesize homeWeb;
- (void)viewDidLoad
{
[viewWeb setDelegate:self];
}
- (void)webViewDidStartLoad:(UIWebView *)webView {
[labelLoading setHidden:NO];
}
- (void)webViewDidFinishLoad:(UIWebView *)webView {
[labelLoading setHidden:YES];
}
{ **This is where the error Expected identifier or "(" occurs**
[super viewDidLoad];
NSString *fullURL = @"http://www.rtics.com/DC1/";
NSURL *url = [NSURL URLWithString:fullURL];
NSURLRequest *requestObj = [NSURLRequest requestWithURL:url];
[viewWeb loadRequest:requestObj];
[super viewDidLoad];
NSString *afullURL = @"http://www.rtics.com/DC2";
NSURL *aurl = [NSURL URLWithString:afullURL];
NSURLRequest *arequestObj = [NSURLRequest requestWithURL:aurl];
[tqwWeb loadRequest:arequestObj];
[super viewDidLoad];
NSString *bfullURL = @"http:/www.rtics.com/DC3/";
NSURL *burl = [NSURL URLWithString:bfullURL];
NSURLRequest *brequestObj = [NSURLRequest requestWithURL:burl];
[blogWeb loadRequest:brequestObj];
[super viewDidLoad];
NSString *cfullURL = @"https://www.rtics.com/DC4";
NSURL *curl = [NSURL URLWithString:cfullURL];
NSURLRequest *crequestObj = [NSURLRequest requestWithURL:curl];
[eventsWeb loadRequest:crequestObj];
[super viewDidLoad];
NSString *dfullURL = @"http://www.rtics.com/DC5";
NSURL *durl = [NSURL URLWithString:dfullURL];
NSURLRequest *drequestObj = [NSURLRequest requestWithURL:durl];
[resWeb loadRequest:drequestObj];
[super viewDidLoad];
NSString *efullURL = @"http://www.rtics.com/";
NSURL *eurl = [NSURL URLWithString:efullURL];
NSURLRequest *erequestObj = [NSURLRequest requestWithURL:eurl];
[homeWeb loadRequest:erequestObj];
}
- (void)viewDidUnload
{
[self setViewWeb:nil];
[self setLabelLoading:nil];
[self setWebView:nil];
[super viewDidUnload];
}
- (BOOL)shouldAutorotateToInterfaceOrientation(UIInterfaceOrientation)interfaceOrientation
{
if ([[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPhone) {
return (interfaceOrientation != UIInterfaceOrientationPortraitUpsideDown);
} else {
return YES;
}
}
@end