nsurlconnection

NSURLConnection leakage

Hi, I'm following the official Apple sample http://developer.apple.com/mac/library/DOCUMENTATION/Cocoa/Conceptual/URLLoadingSystem/Tasks/UsingNSURLConnection.html While examining my code with Instruments I found a leak, caused by the non released NSURLRequest. I've now included a [request release] shortly after NSURLConnection *con...

Bug with NSURLConnection.....?

I am trying to send the data to server from my IPhone client. It works fine for most values but when i try to send a string like "IPhone+Cocoa" the server shows the string as "IPhone Cocoa". I have tried to google it but without success is there any why of doing it. Here is my code -(void)sendRequestNSString *)aRequest { NSMutableURLR...

Delayed UIImageView Rendering in UITableView

Ok, I've got a UITableView with custom UITableViewCells that each contain a UIImageView whose images are being downloaded asynchronously via an NSURLConnection. All pretty standard stuff... The issue is, when the table scrolls, the new images are downloaded in the background correctly but not RENDERED until the table stops moving. How ...

Populate UITableView with results of webservice

I have a table view which i want to populate with the results (XML) of my call to a web service. The NSURLConnection and NSMutableURLRequest that are doing the setup for this are currently in my -viewDidLoad method, and i also have all of my UITableView delegate methods in my .m file too. The data is being returned and added to my arr...

Http Posting An Image From Iphone

NSMutableString *url = [[NSMutableString alloc] init]; [url appendString:@"uploadImage.do"]; NSData *imageData = UIImageJPEGRepresentation(selectedImage,1.0); // setting up the request object now NSMutableURLRequest *request = [[[NSMutableURLRequest alloc] init] autorelease]; [request setURL:[NSURL URLWithString:url]]; [request se...

How to handle NSZombies in an asynchronous NSURLConnection?

Hi, I'm currently asynchronously using NSURLConnection with several UIViews (every view handles NSURLConnection as delegate). The problem I have is when user switches views too fast and the delegate becomes NSZombie the app crashes - that is NSURLConnection doesn't have living delegate anymore. So, the first question is if there's a way...

Start .mp3 play half way through with AVAudioPlayer

Ok, this isn't an easy question (at least not yet). I've got AVAudioPlayer working beautifully: I download an mp3 with NSURLConnection then play that data with AVAudioPlayer. My question is how could I start AVAudioPlayer playing at an arbitrary point in the mp3? I can start downloading at an arbitrary point by setting HTTP headers, no...

Does NSURLConnection take advantage of NSURLCache?

I'm trying to figure out how to use the URL loading framework to load URLs taking advantage of caching. I am using NSURLConnections and feeding them NSURLRequests. I have even set the cachePolicy on those requests to NSURLRequestReturnCacheDataElseLoad. The first time I load a request, it does automatically get put in the cache ([NSUR...

NSURLConnection - Is it possible to wait/block on a request?

Hi All, I need to wait for a response from a SOAP webservice, I am calling via a NSURLConnection as I need to manipulate the data being returned and then return it from my class to the calling class. I cant figure out how I can possibly do it. Here is my code at the moment: #import <Foundation/Foundation.h> @interface UsersBLL : NSO...

iPhone Parse Local XML File

I have an iPhone app that does XML parsing from a URL. I have a sample.xml file in my Resources directory (in XCode) that I'd like to use for testing. How do I reference this file in code? I've tried @"sample.xml" as the URL and it doesn't appear to be able to find it. ...

Why does NSURLCredential require both an identity and a certificate list?

In the initWithIdentity:certificates:persistence: method, what is the purpose of the certificates argument? The identity has a certificate associated with it, so which other certificates am I expected to pass to this call? The server is not accepting my certificate, and I suspect it is because I'm calling this wrong. This is my callba...

iPhone NSURLConnection: What to do with returned NSData Object? Google Docs API

I'm working with the Google Docs API in my iPhone application. I've sent the proper POST request, and received a response along with some NSData. If I NSLog the NSData object, I get this: NSData *returnedData = [NSURLConnection sendSynchronousRequest:request returningResponse:theResponse error:NULL]; NSLog(@"%@",returnedData); //outpu...

Synchronous NSURLConnection Threading on iPhone

I started out using asynchronism but to get the returned data became a hassle. I then began using class methods which, I believe, ruled out the possibility of using the delegate methods. So I kept with the synchronous, knowing that this would be an issue but didn't think I would have this much difficulty with a solution. What is the best...

NSURLConnection NSURLRequest proxy for asynchronous web service calls

I have multiple views which make the same NSURLRequest/NSURLConnection request. Ideally, in order to get some code reuse, I'd like to have some sort of a "proxy" which does all the underlying work of creating/executing the (asynchronous) request/connection, setting up all the delegate methods, etc., so I don't have to copy all those NSUR...

UITableView Lazy Image Load, images appear after table STOPS scrolling..

I implemented lazy image load for my UITableView using NSUrlConnection. This is all working very nicely. When I open my table, I automatically get the images when I wait for a second (on 3G). However, when I scroll, the table loads the new cell's, starts the NSURLConnections, but when the image is finished loading (in code), they do not ...

Submitting a Form to a Web Server using NSUrlConnection

What's the quickest or best way to create and submit a form to a remote web server (http) using NSUrlConnection? I assume I can build the form in Interface Builder, but I'm clueless as to where to go from there, even though I've read several resources on both (including the docs). Just not sure how to put two-and-two together. ...

connectionDidFinishLoading - how to force update UIView?

I am able to download a ZIP file from the internet. Post processing is done in connectionDidFinishLoading and works OK except no UIView elements are updated. For example, I set statusUpdate.text = @"Uncompressing file" but that change does not appear until after connectionDidFinishLoading has completed. Similarly, the UIProgressView a...

Suggestions needed for architecting my code.

Background I'm writing an part of my app that has no UI. It sits in the background watching what you do and timing your work. There should be no overlapping times, and there should be no breaks in the time data. If there are either of these things, the app has a bug somewhere and I need to be notified. What I Want A class called JG...

How to check if a file exists at particular URL?

Dumb question, but how do I check if a file exists on a web site. I am using NSURLConnection with my NSURLRequest and an NSMutableData object to store what comes back in the didReceiveData delegate method. In the connectionDidFinishingLoading method I then save the NSMutableData object to the file system. All good. Except if the file...

asynchronous XML-RPC requests and NSNotifications

Hello, I'm using the XMLRPC framework (by Eric Czarny) for iPhone to communicate with my server. I am using the XMLRPCConnection class (which is basically an extension of NSURLConnection) to create asynchrnous HTTP requests to fetch my data. The connectionDidFinishLoading method sends one and the same NSNotification each time data has b...