Reputation: 328
This is my code. While Running this, I get the below error.,,
Undefined symbols for architecture i386:
"_OBJC_CLASS_$_Reachability", referenced from:
objc-class-ref in ASKViewController.o
ld: symbol(s) not found for architecture i386
clang: error: linker command failed with exit code 1 (use -v to see invocation)
-(void) checknetork{
Reachability *reach=[Reachability reachabilityWithHostName:@"http://www.google.com.sg"];
NetworkStatus netstatus=[reach currentReachabilityStatus];
bool net;
switch (netstatus)
{
case NotReachable:
net=NO;
break;
case ReachableViaWiFi:
net=YES;
break;
case ReachableViaWWAN:
net=YES;
break;
}
if (net)
{
HUD.labelText=@"Connecting.,,";
HUD.customView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@""]];
HUD.mode = MBProgressHUDModeCustomView;
[HUD hide:YES afterDelay:2];
return;
}
else
{
UIAlertView *alert=[[UIAlertView alloc] initWithTitle:@"Alert.!" message:@"Check Your Network Connection.!" delegate:self cancelButtonTitle:@"OK" otherButtonTitles:nil];
[alert show];
}
}
Upvotes: 0
Views: 3227
Reputation: 4345
Select target go to build phases select compile sources click on + and select rechability.m you are sorted
Upvotes: 1