nsurlconnection

Can canceling a NSURLConnection lead to problems?

Before my view loads I call: [theConnection cancel]; //assume theConnection is an NSURLConnection I then proceed and make my proper NSURLConnection. Will calling cancel before a connection is even made cause any problems? ...

How do I track the download progress of gzip encoded web content?

I'm writting an iPhone client that downloads stuff from the net. Since the cellular network is not so fast, and files might be big, I wanted to improve upon the activity spinner with a progress bar. So far so good, I'm using NSURLConnection and checking the Content-Length header to see how many bytes I will download. Then, in the didRec...

NSURLRequest with HTTPBody input stream: Stream sends event before being opened

I want to send a large amount of data to a server using NSURLConnection (and NSURLRequest). For this I create a bound pair of NSStreams (using CFStreamCreateBoundPair(...)). Then I pass the input stream to the NSURLRequest (-setHTTPBodyStream:) and schedule the output stream on the current run loop. When the run loop continues, I get the...

send the user input to the xe.com and just fetch the result to display it in the program in objective c

hi all i want to use just the result of any online currency converter as a variable in to my program. double amount_d; amount_d=[amount doubleValue]; NSString *mar=[NSString stringWithFormat:@"http://www.xe.com/ucc/convert.cgi? Amount=%d&From=%@&To=%@",amount_d,code1,code2 ]; [[NSWorkspace sharedWorkspace] openURL:[NSURL URLW...

Why does a UITableView data source get loaded after rows are created?

I have an interesting problem. I am loading a UITableView asynchronously. I am trying to get the count: prefs = [NSUserDefaults standardUserDefaults]; NSInteger dmCount = [prefs integerForKey:@"dmCount"]; NSLog(@"items count %d", [self.items count]); if (abs([self.items count] - dmCount) > 0) { [prefs setInteger:abs([self.items...

Why NSURLConnection blocks my UI? [Solved]

I've been reading several threads and questions about this issue but I didn't find the solution. I have some asynchronous calls performed with [NSURLConnection connectionWithRequest:anURLRequest delegate:self]; The problem is that I want the interface to be operative but it is blocked until the connection is finished. Is this solve...

Time out with Synchronous NSURLConnection

I am writing an application that uses Synchronous NSURLConnection(s) and am finding that my application hangs if the url entered is incorrect. I tried to set a time out of .5 seconds but it does not seem to take. I read somewhere that it is not possible to set a time out on a Synchronous request (and yes it is very important to the appli...

How to download a file by using NSURLConnection?

Hi, everyone, I want to ask a question about the objective C. I want to download a .vcf file from a server (CardDav server) in iPhone application. After I read the API and library of the Apple Developer, I found that I should use the NSURLConnection Class. However, I don't know how to start the program. Therefore, I want to ask can any...

Session Maintenance for Login Page

Hi friends, My Requirement: I want to send login details(email, password) to server, have to maintain session for valid username. How to create & maintain a session using "NSURLConnection" of iphone SDK? If you found any Tutorials/Code snippets on this issue,Please post the corresponding linke here. Advance thanks for your help. ...

scheduling async downloads in main thread's runloop vs bg thread's runloop on iOS?

Here's a slide from WWDC 2010 session 208: conn = [[NSURLConnection alloc] initWithRequest:req delegate:self startImmediately:NO]; [conn scheduleInRunLoop: [NSRunLoop currentRunLoop] forMode: NSDefaultRunLoopMode]; [conn start]; Are there any problems associated with putting multiple conn's in the currentRunLoop? What benefits do...

Multiple NSURLConnection & NSRunLoop

Hi, I am trying to speed up my application download speed. I used Asynchronous NSURLConnection to download contents from the server, it was working fine with one connection. I use the code from this post to implement multiple delegate objects. http://stackoverflow.com/questions/203294/multiple-nsurlconnection-delegates-in-objective-c ...

What is the maximum size of data we can send using POST of NSURLConnection?

Can some one say the maximum size of the data we can send using NSURLConnection. I am planning to send a data to a server that would minimally have 5 MB size. So I wanted to check is there any bound on the size of the data we can send. If there are any please tell a way to get out of this problem? ...

Cocoa Touch: How to detect a missing file on the download server

My iOS app downloads document files from a server using the NSURLConnection class. I use it asynchronously. It can happen that a document is missing from the server (configuration error). I expected NSURLConnection to call my delegate error method: - (void)connection:(NSURLConnection *)connection didFailWithError:(NSError *)error But...

how to convert php return NSData into NSDictionary

HI, i am creating an login screen to my iphone application. i am sending the username and password to php using NSURLConnection method. i can successfully send login details to php. My php page returning status values based on the login details. (status =OK / Fail , redirectionUrl=http://www.balalaa.com) In DidReceiveData method if i c...

Delegate functions not being called

Hi all, Long time lurker, first time poster. I'm making a ServerConnection module to make it a whole lot modular and easier but am having trouble getting the delegate called. I've seen a few more questions like this but none of the answers fixed my problem. ServerConnection is set up as a protocol. So a ServerConnection object is cre...

App loads images over wifi, but not 3g

I am having a really weird issue. My app runs great on wifi, all of my images load from the net. If i run the app for the very first time on 3G, images wont load. If I switch to wifi, then switch back to 3G, images will load (new images load as well as they change). I have no idea how to diagnose. ...

Is the Apple NSURLConnection Documentation Wrong?

// Create the request. NSURLRequest *theRequest=[NSURLRequest requestWithURL:[NSURL URLWithString:@"http://www.apple.com/"] cachePolicy:NSURLRequestUseProtocolCachePolicy timeoutInterval:60.0]; // create the connection with the request // and start loading the data NSURLConnection *theConnectio...

NSURLConnection Data broken in asynchronous connection

Hello, I have a NSURLConnection that receives data output from a url pointing to a php script on my server. Most of the time everything works fine and the data is retrieved in its complete form. However, sometimes I receive NULL or broken (ie the bottom half) of data at: - (void)connection:(NSURLConnection *)connection didReceiveData...

NSURLConnection optimization

I'm trying to understand NSURLConnection performance on a 3G network from an iPhone. I have the following test code -(void)doTest2 { max = 5; NSURL *url = [NSURL URLWithString:@"http://www.google.com"]; NSURLRequest *request2 = [[[NSURLRequest alloc] initWithURL:url] autorelease]; NSURLConnection *conn=[[NSURLConn...

Strange problem with appendData in didReceiveData method of NSURLConnection

Hi! I got this weird problem in implanting simple NSURLConnection... The method didReceiveData get call and I'm happily trying to append the receive data but... nada! There's some data for sure (as the length indicate but appendData do NOT append the data! I start to bang my head on this one and I need some help before it's to late ...