UIWebView has a didFailLoadWithError handler - have you tried that?

On Tue, Jul 10, 2012 at 5:56 PM, vulcanCCIT
<[email protected]>wrote:

> I am trying to properly catch a failed webview load if you loose network
> connectivity.  I thought a timeout would work but it does not seem to help.
> Perhaps I need to use the Reachability class? prior to the
> webView.LoadRequest() ? I am using that in other parts of my code but I
> thought this try/catch would work:
>
>
>                 private void OnRefreshSelected (Object o, EventArgs args)
>                 {
>                         try {
>                                 this.Title = "Loading...";
>
> UIApplication.SharedApplication.NetworkActivityIndicatorVisible = true;
>                                 webView.LoadRequest (new NSUrlRequest (new
> NSUrl (_camURL),
> NSUrlRequestCachePolicy.ReloadIgnoringLocalCacheData, 30));
>
>                                 webView.LoadFinished += delegate {
>
> UIApplication.SharedApplication.NetworkActivityIndicatorVisible = false;
>                                 this.Title = _boardName;
>                                 };
>                         }
>                         catch(Exception ex)
>                         {
>                                 var alert = new UIAlertView ("Error",
> ex.ToString(), null, "Ok");
>                                 alert.Show();
>                         }
>                 }
>
>
> --
> View this message in context:
> http://monotouch.2284126.n4.nabble.com/detecting-a-failed-webview-load-tp4655917.html
> Sent from the MonoTouch mailing list archive at Nabble.com.
> _______________________________________________
> MonoTouch mailing list
> [email protected]
> http://lists.ximian.com/mailman/listinfo/monotouch
>
_______________________________________________
MonoTouch mailing list
[email protected]
http://lists.ximian.com/mailman/listinfo/monotouch

Reply via email to