I am using Reachability but its showing device is connected through wifi or cellular data. I just want if device is connected to internet or not. I just used some code, its working fine but app is getting freez if device not connected to internet.
struct hostent*hostinfo;
char*hostname="google.com";
hostinfo=gethostbyname(hostname);
if (hostinfo == NULL){
NSLog(@"-> no connection!\n");
}