Unexpected result when checking network reachability
<p>In my app I implemented the code for network reachability. 
This is my code.</p>

<pre><code>-(void)viewDidLoad {
// Test for internet.
gotInternet = [self checkInternet];
if (gotInternet == NO) {
    // No Internet.
    UIAlertView *alert = [[UIAlertView alloc]initWithTitle:@"Connection Error" message:@"The internet is down" delegate:self cancelButtonTitle:@"OK" otherButtonTitles:nil, nil];
    [alert show];
    [alert release];

}
else {
    NSLog(@"I do have internet");
}

}


-(BOOL)checkInternet {
//Test for Internet Connection
NSLog(@"——–");
NSLog(@"Testing Internet Connectivity");
Reachability *r = [Reachability reachabilityWithHostName:@"https://mobile.areafinancial.com/cutechservice/cutechwebservice.asmx"];
NetworkStatus internetStatus = [r currentReachabilityStatus];
BOOL internet;
if ((internetStatus != ReachableViaWiFi) &amp;&amp; (internetStatus != ReachableViaWWAN)) {
    internet = NO;
} else {
    internet = YES;
}
return internet;
}
</code></pre>

<p>This code returns me gotInternet = NO; Actually WiFi is enabled. What am i doing wrong?</p>

<p>Thank you in advance.</p>
