ios - checking Internet connection with Reachability is not working -


Hi, I am checking the Internet connection in my application. So I have already imported accessibility h file and m file in the project. I am having some problems about this now

  - (BOOL) accessible to   

Richability * Access = [Rebility Accessible Name: @ "https://www.google.co.in/"]; NetworkStats InternetStatus = [reaching current Reachability Stats]; If you do not have an internet connection to send the message "Representative: Self cancel buttonTitle: @" Cancel "and" Cancel " Other button titles: @ "OK", zero]; [Alerton Show]; [Warning issued]; } Yes return; }

I have already used this project in my work in other projects, but here the warning message is showing when the Internet is not comparing it when it is not connected. ..

This View Dedload Code ...

  [Super Viewedload]; [Self accessible];  

pls can anyone tell me how to solve this ...

thanks

Try to code down

  rechargeability * access = [Reachability Possibility for Internet connection]; // (or) Reaturability * Access = [Rebility Accessibility] withhostname: @ "http://www.google.com"]; Netwertus netstatus = [reaching current retraceability stats]; If (netstats! = Not recoverable) {// accessible. Network connection available} other {// NSLog (@ "network error network is not available"); UIAlertView * alertView = [[UIAlertView alloc] initWithTitle: @ "" Message: @ "Please connect to an internet connection to register" rep: zero cancelTenTital: @ "OK" other button button: zero, zero]; [Show warning view]; }  

This works for you ...


Comments

Popular posts from this blog

ios - How do I use CFArrayRef in Swift? -

eclipse plugin - Run java code error: Workspace is closed -

c - Error on building source code in VC 6 -