Advertise Mobile SDKs Books Events Forum News Social Networking Support Us
Follow @iphonedevsdk on Twitter

Interface 2, Advanced iOS
Mockup & Code Gen
($9.99)

Make your own iPhone apps
and run them live!
(free)

Pic Frame Dynamo: Photo Editing
($0.99)

Abiliator
($1.99)

Want your application or service advertised on iPhone Dev SDK?

Go Back   iPhone Dev SDK Forum

View Single Post
Old 10-08-2011, 03:39 AM   #29 (permalink)
SnoopDog
Registered Member
 
Join Date: Oct 2011
Posts: 1
SnoopDog is on a distinguished road
Default Simple ERROR CODE for iPhone

here is a simple code that works for iPhone webview error.


in the .h file add:

IBOutlet UIWebView *webView;

in the .m file add:

}
- (void)webViewUIWebView *)webView didFailLoadWithErrorNSError *)error {

UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"Error" message:@"WebView did not load. Please check your internet connection and re-launch the app." delegate:self cancelButtonTitle:@"Dismiss" otherButtonTitles:nil];
[alert show];
[alert release];

}

- (void)viewDidLoad {
[super viewDidLoad];

[webView loadRequest: [NSURLRequest requestWithURL:[NSURL URLWithString:@"http://whatever.com"]]];
SnoopDog is offline   Reply With Quote
 

» Advertisements
» Online Users: 428
14 members and 414 guests
aziz, diane21, elhanche, freewind, guillermotricia, hrushikeshaddon, iram91418, nicsmotherman, pipposanta, PixelEnvision, poke, QuantumDoja, ryantcb, subhan1
Most users ever online was 1,387, 04-10-2012 at 04:21 AM.
» Stats
Members: 175,609
Threads: 94,084
Posts: 402,784
Top Poster: BrianSlick (7,990)
Welcome to our newest member, diane21
Powered by vBadvanced CMPS v3.1.0

All times are GMT -5. The time now is 04:51 AM.
Powered by vBulletin® Version 3.8.0
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.