title: iPhone reachability checking
body: <p>I've found several examples of code to do what I want (check for reachability), but none of it seems to be exact enough to be of use to me. I can't figure out why this doesn't want to play nice.</p>
  
  <p>I have the reachability.h/m in my project, I'm doing</p>
  
  <pre><code>#import &lt;SystemConfiguration/SystemConfiguration.h&gt;
  </code></pre>
  
  <p>And I have the framework added. I also have: </p>
  
  <pre><code>#import "Reachability.h"
  </code></pre>
  
  <p>at the top of the .m in which I'm trying to use the reachability.</p>
  
  <pre><code>Reachability* reachability = [Reachability sharedReachability];
  [reachability setHostName:@"http://www.google.com"];    // set your host name here
  NetworkStatus remoteHostStatus = [reachability remoteHostStatus];
  
  if(remoteHostStatus == NotReachable) {NSLog(@"no");}
  else if (remoteHostStatus == ReachableViaWiFiNetwork) {NSLog(@"wifi"); }
  else if (remoteHostStatus == ReachableViaCarrierDataNetwork) {NSLog(@"cell"); }
  </code></pre>
  
  <p>This is giving me all sorts of problems. What am I doing wrong? I'm an alright coder, I just have a hard time when it comes time to figure out what needs to be put where to enable what I want to do, regardless if I want to know what I want to do or not. (So frustrating)</p>
  
  <p>Update: This is what's going on. This is in my viewcontroller, which I have the </p>
  
  <pre><code>#import &lt;SystemConfiguration/SystemConfiguration.h&gt;
  </code></pre>
  
  <p>and</p>
  
  <pre><code>#import "Reachability.h"
  </code></pre>
  
  <p>set up with. This is my least favorite part of programming by far.<a href="https://i.stack.imgur.com/WNNef.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/WNNef.png" alt="reachability problems"></a><br>
  <sub>(source: <a href="http://sneakyness.com/reachability.png" rel="nofollow noreferrer">sneakyness.com</a>)</sub>  </p>
  
  <hr>
  
  <p>FWIW, we never ended up implementing this in our code. The two features that required internet access (entering the sweepstakes, and buying the dvd), were not main features. Nothing else required internet access. </p>
  
  <p>Instead of adding more code, we just set the background of both internet views to a notice telling the users they must be connected to the internet to use this feature. It was in theme with the rest of the application's interface, and was done well/tastefully. They said nothing about it during the approval process, however we did get a personal phone call to verify that we were giving away items that actually pertained to the movie. According to their usually vague agreement, you aren't allowed to have sweepstakes otherwise. </p>
  
  <p>I would also think this adheres more strictly to their "only use things if you absolutely need them" ideaology as well.  </p>
  
  <p><a href="http://itunes.apple.com/us/app/evo-scanner/id345957272?mt=8" rel="nofollow noreferrer">Here's the iTunes link to the application, EvoScanner.</a></p>