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 > iPhone SDK Development Forums > iPhone SDK Development

Reply
 
LinkBack Thread Tools Display Modes
Old 02-24-2010, 11:27 AM   #26 (permalink)
Registered Member
 
Join Date: Feb 2010
Posts: 1
Default how to set timeout?

Hi!
I read all the posts here and there is currently no working solution for setting timeout. Fe.: wait(20000); writes "Passing argument 1 of wait makes pointer from integer without a cast"...

Is there any way how to create timeout for:

- (BOOL) connectedToNetwork
{
return ([NSString stringWithContentsOfURL:[NSURL URLWithString:@"http://www.google.com"] encoding:NSASCIIStringEncoding error:nil]!=NULL)?YES:NO;
}
?

Thanks a lot.
mirap is offline   Reply With Quote
Old 05-12-2010, 02:20 PM   #27 (permalink)
Registered Member
 
Join Date: Apr 2010
Posts: 2
Default

Quote:
Originally Posted by Steaps View Post
Nothing after the return statement is being called. Try using NSLog() to see where code ends/if it's called.
your code didnt work because you are returning

yu need to take out the return you have and instead assign the results to a bool variable and test that in the if statement, you cant put if(YES) because YES is a constant, it will always go into the if statement
maniatis1 is offline   Reply With Quote
Old 07-29-2010, 03:29 PM   #28 (permalink)
Registered Member
 
Join Date: Jul 2010
Posts: 1
Default

Hi Guys

maybe someone of you knows about the solution how to recognize from which network(umts, gprs, or wifi) mobilephone want to get connection. i will added that this is the web page which will be modify depend on bandrange.

if you know about such solution or something similar please send me e-mail, kynio82@gmail.com

thanks for advice

Chris
Chris82 is offline   Reply With Quote
Old 10-08-2011, 04:39 AM   #29 (permalink)
Registered Member
 
Join Date: Oct 2011
Posts: 1
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
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



» Advertisements
» Online Users: 261
23 members and 238 guests
ADY, AragornSG, bookesp, chillyh, dacapo, Dani77, Davey555, Desert Diva, Dominus, glenn_sayers, HemiMG, JasonR, LEARN2MAKE, M.A.S., marshusensei, mer10, nobre84, Oral B, prchn4christ, Raggou, Rudy, spiderguy84, themathminister
Most users ever online was 1,187, 10-11-2011 at 08:09 AM.
» Stats
Members: 158,885
Threads: 89,230
Posts: 380,765
Top Poster: BrianSlick (7,129)
Welcome to our newest member, bookesp
Powered by vBadvanced CMPS v3.1.0

All times are GMT -5. The time now is 02:30 PM.
Powered by vBulletin® Version 3.8.0
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.3.0