我已经被这个语义问题警告困扰了一个星期,而且变得令人沮丧。有人愿意看看吗?任何建议都将被亲切地采纳。<3
WebViewController.m
#import "WebViewController.h"
#import "Reachability.h"
@implementation WebViewController
@synthesize webView;
@synthesize backbtn;
@synthesize forwardbtn;
@synthesize webAddy;
@synthesize activityIndicator;
@synthesize loadingLabel;
- (void)viewDidLoad {
loadingLabel.hidden = YES;
backbtn.enabled = NO;
forwardbtn.enabled = NO;
webView.scalesPageToFit = YES;
activityIndicator.hidesWhenStopped = YES;
if([Reachability currentReachabilityStatus] == NotReachable)
{
UIAlertView *av = [[[UIAlertView alloc]
initWithTitle:@"Sorry"
message:@"You are not connected to the internet. Please Try again"
delegate:nil
cancelButtonTitle:@"OK"
otherButtonTitles:nil] autorelease];
[av setDelegate:self];
[av show];
}
else
{
NSURL *url = [NSURL URLWithString:webAddy];
NSURLRequest *requestObj = [NSURLRequest requestWithURL:url];
[webView loadRequest:requestObj];
}
[super viewDidLoad];
}
警告将我重定向到第 20 行。编译器告诉我:“找不到类方法‘+currentReachabilityStatus’(返回类型默认为‘id’) ”
如果需要更多信息,请告诉我。再次感谢大家!