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

Mockup & CodeGen, iPhone & iPad
($9.99)

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

Manu
($0.99)

Want your application or service advertised on iPhone Dev SDK?

Go Back   iPhone Dev SDK Forum

View Single Post
Old 11-18-2009, 10:30 AM   #20 (permalink)
Steaps
Tutorial Author
 
Steaps's Avatar
 
Join Date: Oct 2008
Location: Ontario, Canada
Posts: 466
Default

Quote:
Originally Posted by redon View Post
i tryed the following code, put my iphone in airplane mode and ran the app. it appears to not work...at all


Code:
- (BOOL) connectedToNetwork {
	return ([NSString stringWithContentsOfURL:[NSURL URLWithString:@"http://www.apple.com/"]]!=NULL)?YES:NO;
	
	if (YES) {
	}
	
	if (NO) {
		UIAlertView *alert = [[UIAlertView alloc] initWithTitle:nil message:@"no internet connection" 
													   delegate:self cancelButtonTitle:@"OK" otherButtonTitles:nil];
		[alert show];
	    [alert release];
	}
}
Nothing after the return statement is being called. Try using NSLog() to see where code ends/if it's called.
Steaps is offline   Reply With Quote
 

» Advertisements
» Online Users: 295
22 members and 273 guests
ADY, antonwilliams, apatsufas, dacapo, dcool, HemiMG, iosdevjtp, jakerocheleau, leahov, MarkC, marto1914, masc2279, morands, MozyMac, PsychoChris, sly24, smithdale87, sneaky, Sunny46, thh022, timle8n1, vogueestylee
Most users ever online was 1,187, 10-11-2011 at 08:09 AM.
» Stats
Members: 158,877
Threads: 89,222
Posts: 380,720
Top Poster: BrianSlick (7,129)
Welcome to our newest member, peterkessler45
Powered by vBadvanced CMPS v3.1.0

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