到達可能性*到達可能性=[到達可能性reachabilityForInternetConnection]; BOOL remoteHostStatus = [reachability currentReachabilityStatus];
if (remoteHostStatus == ReachableViaWiFi || remoteHostStatus == ReachableViaWWAN)
{
[MBProgressHUD showHUDAddedTo:self.view animated:YES];
NSMutableDictionary *dict = [[NSMutableDictionary alloc] initWithObjectsAndKeys:textFieldUserName.text,@"email",textFieldpass.text,@"password", nil];
objApp.responseData = [[NSMutableData data]init];
objApp.request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:[NSString stringWithFormat:@"%@login",mainUrl]]];
NSData * requestBodyData = [NSJSONSerialization dataWithJSONObject:dict options:0 error:NULL];
objApp.request.HTTPMethod= @"POST";
[objApp.request setHTTPBody:requestBodyData];
[objApp.request setTimeoutInterval:8.0f];
// Create url connection and fire request
objApp.connection = [[NSURLConnection alloc] initWithRequest:objApp.request delegate:self];
}
else
{
[objApp alertViewFromApp:@"check internet connection of device"];
}