Reachability - Best practice before showing webView
<p>I would like to check "reachability" before/when a webView is shown in my app.</p>

<p>So far I've included the reachbility.h/.m files as well as added the SystemConfiguration.framework to the project.</p>

<p>And that's about where the agreements I have found on the internet end, from all of the posts and blogs etc. etc. everyone has a different idea/opinion of what to do after that.  Additionally, I have found a lot partial code snippets that aren't really a complete solution, on which reachibility methods to call etc. etc. how to use them etc.</p>

<p>I have also found that some warn that you should try to reconnect before checking reachability...but I haven't found a consensus or a full solution.  My app seems to reconnect to wifi without any extra code... so I'm a litte confused here too...</p>

<p>Any help to clear the muddy waters would be appreciated.  I'm just looking for a simple straightforward solution.</p>

<p>Answer Accepted:  I would like to note to newbies who may read this q/a later... that you will want to do the following:</p>

<p>Add this into your .h file:</p>

<ul>
<li>(BOOL) connectedToNetwork: (NSString *) remoteServer;</li>
<li>(void) appLoadError: (NSString *) altertTitle alertMessage: (NSString *) altertMsg;</li>
</ul>

<p>And you will need to import these at the top of your .m file:</p>

<p>sys/socket.h</p>

<p>netinet/in.h</p>

<p>netinet6/in6.h</p>

<p>arpa/inet.h</p>

<p>ifaddrs.h</p>

<p>netdb.h</p>

<p>SystemConfiguration/SystemConfiguration.h</p>

<p>Correct me if it is wrong... It seems to work fine for me...</p>
