nsurlconnection

NSMutableURLRequest “The request timed out” issue . .

筅森魡賤 提交于 2019-12-06 06:29:01
问题 I am trying to download data in my application by using the following code NSURL *url = [NSURL URLWithString:@"my download url string"]; NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:url cachePolicy:NSURLRequestReloadIgnoringCacheData timeoutInterval:60.f]; NSURLConnection * connection = [NSURLConnection connectionWithRequest:request delegate:self]; [connection start]; but the problem is some times i am getting the following error Error Domain=NSURLErrorDomain Code=-1001

Recommended alternative to webkit for server-sent events on iOS [closed]

蹲街弑〆低调 提交于 2019-12-06 06:22:24
问题 Closed. This question is off-topic. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed 4 years ago . I would like to receive Server-Sent Events in my native iOS app however am not using webkit/Safari. From what I've found, NSURLConnection is poor fit as it chunks response . I've also looked at ZTWebSocket library (obviously nice, but I'm seeking SSE, not web sockets). Would CocoaAsyncSocket be appropriate? Or

Reachability on iPhone app with a false positive - will it get past apple?

99封情书 提交于 2019-12-06 05:30:36
I am using this code... Reachability *r = [Reachability reachabilityWithHostName:@"www.maxqdata.com"]; NetworkStatus internetStatus = [r currentReachabilityStatus]; if ((internetStatus != ReachableViaWiFi) && (internetStatus != ReachableViaWWAN)) { UIAlertView *myAlert = [[UIAlertView alloc] initWithTitle:@"No Internet Connection" message:@"You require an internet connection via WiFi or cellular network for location finding to work." delegate:self cancelButtonTitle:@"Ok" otherButtonTitles:nil]; [myAlert show]; [myAlert release]; } from this thread http://www.iphonedevsdk.com/forum/iphone-sdk

What is the situation regarding the NSURLConnection timeout with iOS5?

最后都变了- 提交于 2019-12-06 04:48:26
问题 I'm trying to find a definitive answer to if it possible to set the timeout value for using NSURLConnection in iOS 5 (I would like to set it to 30 seconds). I've searched past postings on this but the information seems contradictory. For example, this posting NSURLConnection timeout? says Apple mandates a 4 minute minimum timeout - though I cannot find any Apple documentation to support this. THis posting says the 240 limit comes from an apple forum thread NSMutableURLRequest not obeying my

Clear the credentials from UIWebView

佐手、 提交于 2019-12-06 03:49:57
问题 What i am doing here is, fetching a URL which has authentication. Hence, i use the function - (void)connection:(NSURLConnection *)connection didReceiveAuthenticationChallenge:(NSURLAuthenticationChallenge *)challenge; When it faces authentication, i present a UIAlertView to enter the username and password and if user has entered it correctly, this method is called. - (void)connection:(NSURLConnection *)connection didReceiveResponse:(NSURLResponse *)response; in this method, i make the login

Application rejected with the reason of lack of IPv6 support [closed]

吃可爱长大的小学妹 提交于 2019-12-06 03:48:16
Closed . This question is opinion-based . It is not currently accepting answers. Want to improve this question? Update the question so it can be answered with facts and citations by editing this post . Closed last year . My last release of application which is 12.8 is rejected by apple saying that i have to add the IPv6 support to the app, I read and reviewed the recommended apple doc named Supporting IPv6 DNS64/NAT64 Networks thoroughly and came to know that already i am using the NSURLConnection class for network connectivity which is mentioned in the same doc, you can see the image from doc

Multiple async webservice requests NSURLConnection iOS

吃可爱长大的小学妹 提交于 2019-12-06 02:44:29
问题 I have a problem that Im not sure how to tackle. I can without any problem make requests to the REST service when passing a single request. My problem now is at based on that respons i get some values including ID´s. All ID´s retrieved will then need make another request to collect new information. My guess is to load all the specific request in a array or dictionary and create request from that. Anyone have some useful tips regarding this? The information retrieved will then populate a

NSURLConnection and keep-alive

↘锁芯ラ 提交于 2019-12-06 01:58:22
问题 I have a small bug in my client app that uses NSURLConnection. I have tracked it down to an unexpected connection keep-alive that seems to confuse the web server (probably a bug on the server side). The workaround would be to force-close all outstanding connections at a certain point. Can I do this somehow with NSURLConnection, i.e. something like [NSURLConnection closeAllIdleConnections]; 回答1: ASIHTTPRequest has an expirePersistentConnections method. It may do what you're looking for. It's

Downloading a large file in iOS app

三世轮回 提交于 2019-12-06 01:51:26
I'm trying to clean up some existing code that downloads a large file from a server in chunks, checks the checksum on each 50 packets, then stitches them together. I'm having some trouble to see if it's the most efficient way as right now it crashes some time because of memory issues. If I don't have the checksum, it does not seem to crash, but I would prefer if I could check my files first. @property (nonatomic, retain) NSMutableData * ReceivedData; - (void)connectionDidFinishLoading:(NSURLConnection *)connection { NSData *sequencePacketData = [[NSData alloc] initWithData:self.ReceivedData];

NSURLConnection and multitasking in iOS

浪子不回头ぞ 提交于 2019-12-05 22:16:37
问题 I'm using NSURLConnection to download resources asynchronously in iOS. (They are large-ish PDF files, so it takes some time on a slow connection.) Now I'm updating my app from iOS 3 to iOS 4. As my app is none of location-aware, voip, and background music, I guess I need to do something. My question is, then, what happens to the NSURLConnection currently running? Is it suspended and magically resumed when the app comes back to the foreground, or is it outright killed? If it is the latter,