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 02-05-2009, 07:44 PM   #13 (permalink)
Bungler
New Member
 
Join Date: Feb 2009
Posts: 2
Default

OK, I think I have resolved the issue above with some research on this forum. I changed the last IF statement to the following:

Code:
...
return ((isReachable && !needsConnection) || nonWiFi) ? 
(([[NSURLConnection alloc] initWithRequest:[NSURLRequest 
requestWithURL: [NSURL URLWithString:@"http://www.apple.com/"] 
cachePolicy:NSURLRequestReloadIgnoringLocalCacheData timeoutInterval:20.0] 
delegate:self]) ? YES : NO) : NO;
...
What (I think) its doing is after it tests for reachability, it requests data from a www site using NSURLConnection, which makes the iPhone search for connections. Sorry for my non-technical explanations


EDIT: I changed the cache policy to not pull from the local cache so that it looks for the page every time. In my code, I also am not using apple.com as the request URL. I put up a simple html page on my server with the word 'true' in it and I am requesting that page for the connection testing. Keeping the request small might help the load time, even if you are doing nothing with the requested data. Even a 404 returns something.

Last edited by Bungler; 02-05-2009 at 08:14 PM.
Bungler is offline   Reply With Quote
 

» Advertisements
» Stats
Members: 158,854
Threads: 89,223
Posts: 380,680
Top Poster: BrianSlick (7,129)
Welcome to our newest member, ijhetro
Powered by vBadvanced CMPS v3.1.0

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