nsurlconnection

How to execute an NSUrlConnection in a separated thread?

Hello everybody, I am moving my first steps both with url connections and threads so bear with me if the question may result trivial. Basically I would like to execute an NSUrlConnection in a separate thread (even if this may result 'dangerous' as many documents state). Before deciding whether to adopt this solution or not I should manag...

Core Data blocking UI after asynchronous NSURLConnection didLoadResource on iPhone

Each time somebody touches a row inside a UITableView, I'm kicking off a series of asynchronous NSURLConnections, that download data and then parse and save that data into Core Data. The problem is that when I do this, the UI is responsive during the data download, but as soon as the parsing and saving begins, the UI becomes non-respons...

Implementation of MVC with SQLite and NSURLConnection, use cases?

I'm interested in knowing how others have implemented/designed database & web services in their iphone app and how they simplified it for the entire application. My application is dependent on these services and I can't figure out a efficient way to use them together due to the (semi)complexity of my requirements. My past attempts on com...

NSURLConnection Error

Hi All, What is "Error Domain=NSURLErrorDomain Code=-1020 UserInfo=0x1694a0 "Operation could not be completed. (NSURLErrorDomain error -1020.)"" due to ?? ...

How do set the max NSURLRequest data size that gets cached?

On the iphone, I'm using NSURLRequest and NSURLConnection to download images into my app. asynchronously. I also want these requests to be cached. What I've noticed is that some of my images do get cached and some don't. I'v implemented the delegate method -(NSCachedURLResponse *)connection:(NSURLConnection *)connection ...

NSMutableURLRequest not obeying my timeoutInterval

I'm POST'ing a small image, so i'd like the timeout interval to be short. If the image doesn't send in a few seconds, it's probably never going to send. For some unknown reason my NSURLConnection is never failing, no matter how short I set the timeoutInterval. // Create the URL request NSMutableURLRequest *request = [[NSMutableURLReque...

SSL certificate for iPhone -> which CA?

I find all these work-arounds for NSUrlConnection's which use a closed API to access a non-trusted SSL certificate. The other options is to install the certificate first by using the Safari/Mail app.. I'd like to know what root certificates are installed, so I can get one from the trusted CA, the way you're supposed to do it.. Anyone ...

Using a proxy for NSURLConnection

Is there any way to get the content of a webfile (namely a .html Document) using a proxy, which is not defined in the system settings? I know that NSURLConnection is the right way to download a web file into a variable and not into a file (for which we should use NSURLDownload), but I don't find a way to use a proxy for it. Are there som...

previousFailureCount always stays on 0 (zero)

Hello all, First of all, I'd like to thank the good people who helped me around on this site. Thanks. I'm trying to detect a failed authentication attempt in my app... I'm using the didReceiveAuthenticationChallenge method, and the checking if [challenge previousFailureCount] is equal to 0. The problem is that it's always stays on zero...

Asynchronous NSURLConnection Throws EXC_BAD_ACCESS

I'm not really sure why my code is throwing a EXC_BAD_ACCESS, I have followed the guidelines in Apple's documentation: -(void)getMessages:(NSString*)stream{ NSString* myURL = [NSString stringWithFormat:@"http://www.someurl.com"]; NSURLRequest *theRequest = [NSURLRequest requestWithURL:[NSURL URLWithString:myURL]]; NSURLCo...

how to manage multiple asynchronous NSURLConnection delegates?

I have a class that makes multiple asynchronous connections where each connection performs its own logic in the delegate methods. Because the delegate is the class itself, how can I implement this separation in logic in the NSURLConnection delegate methods? ...

How to download data from internet with resume option..?

Hi, i am downloading content from server to my app. i am using NSUrlConnection to that in response i am getting data and i am storing that. But if user quits the app while downloading when he launches app next time i have to resume that download from where it stop(download remaining part). how to support this ... is any idea on how to h...

NSURLConnectionDelegate connection:didReceiveData not working

Hi All, I need some help regarding the NSURLConnectionDelegate method. - (void)startDownload { NSString *URLString = [NSString stringWithFormat:appRecord.imageURLString]; NSURL *url = [NSURL URLWithString:URLString]; NSURLRequest *request = [NSURLRequest requestWithURL:url]; imageConnection = [[NSURLConnection alloc] initWithReque...

how to send Transition receipt along with product identifier to my server

Hi how to send Transition receipt along with product identifier to my server using HTTP Post method weather i have to encode product identifier using base 64...? i am getting response {"message" : "21002: java.lang.IllegalArgumentException: propertyListFromString parsed an object, but there's still more text in the string. A plist shoul...

Cant access NString after callback in [NSURLConnection sendSynchronousRequest]

Hi I am trying to get a cookie from a site which I can do no problem. The problem arises when I try and save the cookie to a NSString in a holder class or anywhere else for that matter and try and access it outside the delegate method where it is first created. - (void)connection:(NSURLConnection *)connection didReceiveResponse:(NSURLRe...

iPhone: How to Determine When a Download from a URL has Completed

I need to populate an array using data from a NSURL. How do I determine when the download from the URL has completed? ...

Too many NSURLConnections? Set of NSURLConnections not completing

Hello. I have a class that's very similar to MultipleDownload.m by leonho. Basically, in a pretty tight loop, I spawn a bunch of NSURLConnections and keep track of received data using a method similar to that used in MultipleDownload.m. There are changes in my code that was necessitated by needing to save files to the camera roll in the ...

What is a safe way to check for a protocol response

Here's a scenario: A view controller pushes a new controller to the nav controller. This child controller creates a model that uses a NSURLConnection. When this connection finishes it will make a call like the following: [self.delegate modelDidFinishParsing:self]; What is the safe way to produce this code? Right now, I have this c...

shoutcast pls forbidden for iPhone programatically?

I have been trying to access the pls file data from shoutcast for some testing but the response seems to be forbidden and i am getting 403 as response. here is the code NSURL *myurl = [NSURL URLWithString:@"http://yp.shoutcast.com/sbin/tunein-station.pls?id=9944"] ; //Accept:*/* NSMutableURLRequest *myrequest = [[NSMutableURLRequest a...

Why release the NSURLConnection instance in this statement?

I read this in a book. -(IBAction) updateTweets { tweetsView.text = @""; [tweetsData release]; tweetsData = [[NSMutableData alloc] init]; NSURL *url = [NSURL URLWithString:@"http://twitter.com/statuses/public_timeline.xml" ]; NSURLRequest *request = [[NSURLRequest alloc] initWithURL: url]; NSURLConnection *connectio...