0

I've been trying to implement this (https://github.com/tonymillion/Reachability/) into my iOS iPhone app for 4 hours. I've seen other questions on SO about it, but none explicitly show how to implement the code. Can someone please help?

All I want to do is show an alert if they are not connected (or lose connectivity) to the network (WiFi or Cellular).

Can someone PLEASE tell me what code to put where? Thanks SOOO much! I can post code or anything if needed.

adamdehaven
  • 5,890
  • 10
  • 61
  • 84

1 Answers1

1

Have a look at Apple reachability sample code here : http://developer.apple.com/library/ios/#samplecode/Reachability/Listings/Classes_ReachabilityAppDelegate_m.html#//apple_ref/doc/uid/DTS40007324-Classes_ReachabilityAppDelegate_m-DontLinkElementID_4

I hope that will be helpful,if you need to ask something, put it in the comment and I'll edit my answer.

Moxy
  • 4,162
  • 2
  • 30
  • 49
  • I've looked at Apple's version, but it's not ARC compatible, and to be honest, I can't figure out how to implement it in my app. All I have is a single view that contains a UIWebView that shows an HTML5 mobile site. I just need the app to display an alert if it ever loses network connectivity. – adamdehaven Jul 20 '12 at 13:13
  • All you have to do is to add "-fno-objc-arc" to Reachability.m To do that, select your target and go to the Build phases tab, expand "Compile sources" and double click on Reachability.m and type "-fno-objc-arc" – Moxy Jul 20 '12 at 13:42
  • When you insert `-fno-objc-arc` what does that actually do? And do I have to do anything else for it to show an alert when they lose network connectivity? Or does it "just work"? – adamdehaven Jul 20 '12 at 16:09