nsurlconnection

How Do I Upload Multiple Files Using the iPhone

I am posting (HTTP POST) various values to the posterous api. I am successfully able to upload the title, body, and ONE media file, but when I try to add in a second media file I get a server 500. They do allow media and media[] as parameters. How do I upload multiple files with the iPhone SDK? ...

NSURLCache Memory Size is zero

I am having trouble caching NSURLConnection responses using a synchronous call. I initialize the cache in one class and then use it in another. Notice how the cache memory capacity gets initialized to 100KB but then is magically reset to zero later. - (id)init { if (self = [super init]) { // Creates a custom URL cache that...

iphone NSURLConnection NSTimer works in initWithRequest but causes unrecognized selector error in sendSynchronousRequest

Hi, I need to use an NSTimer to cancel my NSURLRequest before 75 seconds (the time I measured regardless of the timeout I set). I'm using the XMLRPC classes by Eric Czarny. The XMLRPCConnection is basically an image of the NSURLConnection class. Here's the interface and the implementation file: #import <Foundation/Foundation.h> @clas...

NSFileHandle weird problem with iphone

Hi , i am downloading an mp3 file using NSURLConnection and saving it to a file . The problem is mp3 file is created (found the mp3 file created when using simulator), but i cannot access the mp3 file . Any ideas?!!!!! This is the code i'm using filename = [[NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMas...

How to use NSURLRequest / NSURLConnection to download an mp3 file to app?

The Situation In my app, I am currently downloading an mp3 file (to docs directory) using [NSData dataWithContentsOfURL:URL], a method that works fine, but ties down the CPU, dissallowing screen updates of download status. So, I want to download using a different method so that I can update the screen WHILE downloading to alert the user ...

Not getting full download with NSURLConnection GET in iPhone app

Situation I'm using NSURLConnection to download an mp3 file to the documents directory on my app. On the simulator I get the full mp3 file downloaded with no probs. On the device, however, I can only seem to get 1 second of audio for each mp3. I am connecting to a free WiFi point when performing this download from the device, in contrast...

How do you prevent objective-c method execution while waiting for an NSURL connection to finish?

Ok, This may be a very simple question to ask with a very obvious answer but I'm a little stuck on the best way to solve this problem. I am coding an objective-c application using the iPhone SDK. I have some custom objects. These objects execute an NSURL request and send data to a web server, retrieve data back and move on. My problem ...

How to show a UIProgressView for a download in my app?

I would like to show a progress bar indicating how much of a file has been downloaded in my iPhone app. I know how to set up the UIProgressView in IB and all that. But I need data such as file size in bytes to run it. How do I go about integrating such functionality with my byte download code (shown below)? - (void)connection:(NSURLConn...

How to determine the size (in bytes) of a file downloading using NSURLConnection?

I need to know the size of the file I am downloading (in bytes) into my app using NSURLConnection (GET). Here is my bytes recieved code below if it helps. What I need to know is how to get the filesize in bytes so that I can use it to show a UIProgressView. - (void)connection:(NSURLConnection *)theConnection didReceiveData:(NSData *)dat...

NSURLConnection : Bad url problem

It seems that the NSURLConnection have problems with handling æ,ø,å. And the webservice I'm trying to connect to do not handle that I convert them to UTF8 chars. Any suggestions? ...

How to load UIWebView with an html page retrieved by NSURLConnect?

How to load UIWebView with an html page retrieved by NSURLConnect? ...

iPhone UITableView populateing from connectionDidFinishLoading

Hey all. I have been trying for hours to figure this out. I have some JSON from a NSURLConnection. This is working fine and I have parsed it into an array. But I can't seem to get the array out of the connectionDidFinishLoading method. I an am getting (null) in the UITableViewCell method. I am assuming this is a scope of retain issue, bu...

Buffer overflow or Race Condition with multiple NSInputStream, NSOutputStream and NSURLConnection?

Hi, I have a strange problem with some multiple input/output streams and NSURLConnection: First I open each one NSInputStream and NSOutputStream. They are communicating with a socket connection. After some communication I open a second socket connection. After that I need to connect to a web server by using NSURLConnection. After the c...

Problem With NSURLConnection and Location

Hello all , I am using the location manager to generate location data that I send in a URL to down load data. The first time I call the location manager, it correctly returns the current location and based on the current location I can fetch the data from the URL. However, when I attempt to retrieve the current location a second time...

iPhone NSURLConnection: connectionDidFinishLoading - how to return a string to the calling method.

Hi Guys, Could you please help me? I have reviewed similar stackoverflow questions/answers to this but I am still stumped. I'm a beginner and I'm really struggling with this. With the iPhone, I can download XML from a URL but I cannot store the result string in a NSString variable and see it from the calling function. I have the follo...

IPHONE SDK : NSURLConnection asynchronous / wait completion bug ?

Hello all, I am trying to use NSURLConnection in asynchonous mode and wait for completion. During the wait, I use NSRUNLOOP to handle events. Its works in most cases (3G and WIFI) but the application hangup randomly in GSM DATA and EDGE environnement. Anyone can help me ? My code: (void) connectionDidFinishLoading:(NSURLConnection ...

Need to convert NSData to NSArray

I am pulling down a plist from a URL using an NSURLConnection, which returns an NSData object. I would like to convert this to an NSArray. Can anyone help me? I am refactoring a method that currently does a synchronous request to the URL, using arrayWithContentsOfURL: to get the NSArray. Thanks!! ...

nsurlconnecion doesn't return nil even if network is down...

Hi Quite new to network programming and espacially objective-c networking... Even if I shut down the network interface on my computer, or sets my iPhone in flught mode, NSURLConnection won't return nil with the unpleasent surprise that the application dies. I conform to NSURLConnection protocol with all correct callback methods... So...

NSMutableURLRequest: didReceiveData not called at the first time

Hi, I've digged through a lot of topics regarding didReceiveData: method not being called (and the solutions is to set appropriate cachePolicy and implement willCacheResponse delegate method...) And so I did... And now I get didReceiveData message each time anything comes from the server. BUT: Unfortunately I don't get didReceiveData at ...

How to make an progress bar for an NSURLConnection when downloading a file?

I want to show up an progress bar while a download with NSURLConnection is happening. As I am getting data from the server, I could update the UI for every received package. But the problem is: How do I figure out how much data I have already, and how much data has to be downloaded? Probably in bytes... And then I have to do some math to...