nsurlconnection

NSURLConnection in NSOperation

Hi I am writing a code that reads data from a http connection and stores in a byte array. I have written my own NSOperation class. Reference of the code is Concurrent Operations Demystified My HttpWorker class declaration is like @interface HttpWorker : NSOperation{ NSString *param; double requestCode; BOOL isLive; l...

Problem with nsurlconnection timeout.

I've got a wierd problem with NSURLConnection. I've set the connection time out of 20 seconds like this. NSURLRequest *request = [NSURLRequest requestWithURL:url cachePolicy:NSURLRequestUseProtocolCachePolicy timeoutInterval:20.0]; NSURLConnection *con= [[NSURLConnection alloc] initWithRequest:request delegate:self]; I'm implementing ...

Synchonous SSL certificate handling on iPhone

Hi, I was wondering if anyone can help me understand how to add SSL certificate handling to synchronous connections to a https service. I know how to do this with asynchronous connections but not synchronous. NSString *URLpath = @"https://mydomain.com/"; NSURL *myURL = [[NSURL alloc] initWithString:URLpath]; N...

nsurlconnection and iphone simulator

Hi, i am working on a sample ebook app and using nsurlconnection for downloading ebook file from net. enter code here- (void) start { if (![self isCancelled]) { NSLog(@"baslad"); connection_ = [[NSURLConnection connectionWithRequest:[NSURLRequest requestWithURL: download_.url] delegate: self] retain]; if (connection_ != n...

How to test Radio url status ?

sometimes is up sometime is down, how to programmatic test that connection is available? ...

NSURLConnection and keep-alive

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. some...

How to get a plist data from URL to NSArray ?

Here is my code it looks ok But it crash when running NSString *urlAddress = [NSString stringWithFormat:@"http://www....php"]; NSMutableURLRequest *request = [[[NSMutableURLRequest alloc] init] autorelease]; [request setURL:[NSURL URLWithString:urlAddress]]; [request setHTTPMethod:@"GET"]; NSData *returnData = [NSURLConnection sen...

Iphone SOAP request step by step tutorial

I've been looking here for some answers to this question and have found some resources but not really found the "spot on" tutorial. So i would be grateful for any posts of tutorials on howto get SOAP working in an iphone app. I have seen that it can be done using NSURLconnection. But as I am pretty new to Objective C programming i wo...

Making multiple service calls on iPhone app initialization

I need to make multiple asynchronous service calls in the application:didFinishLaunchingWithOptions: method from my application delegate in order to retrieve some data from a service to be used across various controllers in my app. I have control over the service, and I've designed the API to be as RESTful as possible, so I need to make ...

NSURLConnection - how much LEFT to download

Hi there I am downloading video files over wifi through my application to the iphone. I want to make a % downloaded display (eg: loading bar style). I thought about using - (void)connection:(NSURLConnection *)connection didReceiveData:(NSData *)data; but I would need to know how much data there was overall to download. Is there any w...

Help sending cookie value with iphone request.

I am saving a cookie value and then trying to send it back with a later request to use for authentication... it doesn't seem to be working. NSString *savedCookie = [savedData objectForKey:@"savedLoginCookie"]; NSMutableURLRequest *requestObj = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:urlAddress]]; [requestObj addVa...

NSURLConnection or NSurl?

Hi, what is the difference between NSURLConnection and NSUrl? i mean if i am downloading a file, does it make and difference which one i use? Rgds for: NSString *myUrl = @"http://www.test.com/"; NSString *returnData = [NSString stringWithContentsOfURL:[NSURL URLWithString: myUrl]]; or NSString *myUrl = @"http://w...

Cleaning up hanging NSURLConnections when a controller is dealloc'ed

I have a controller that makes HTTP GET requests using a custom class, which acts as the delegate for the NSURLConnection. Once the NSURLConnection fails or finishes, the custom class invokes methods on the controller and passes along an NSData object of received data. I'm running into a problem where the controller in action is being d...

NSURLConnection cache clearing and reconnecting problem problem

Hi, Given a rails application which communicates with my ipad app. I'm using async connection with http authentication. And i would like to test the credentials if they are ok. The problem is that if i enter the good credentials and after that i'm changing to a wrong one, the connection still accepts. Only refuses when I reopen the appl...

handle multiple url for iphone

Hello friends Recently I am working with xml parsing function for iphone. I am viewing thumbnail image in my uitableviewcell through webservice. Its working perfect. Now I got requirement like that....in webservice there are two urls for images. In case url1 could not retrive image or couldnt connect, then image should be displayed by...

How to cancel an asynchronous NSURLConnection

Calling instance method cancel on an NSURLConnection most often don't cancel the connection at all. I'm performing an asynchronous NSURLConnection in an NSOperation. If the operation is cancelled, the connection is stopped by calling cancel on NSURLConnection and then setting the connection to nil. Is there a way to cancel the connect...

Sharing data between two classes

Hi, this is my first iPhone application and I'm using JSON framework to decode JSON sent from a server. I insert the data in a NSMutableArray from an AppDelegate file. - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { responseData = [[NSMutableData data] retain]; ...

iphone : random EXC_BAD_ACCESS with NSURLConnection

Hi guys. I sometimes get crash reports about an EXC_BAD_ACCESS with NSURLConnection (i guess it's about NSURLConnection according to crash reports). I found a question here on StackOverflow with the same kind of report but nothing helped there :/ (http://stackoverflow.com/questions/3111051/nsurlconnection-causes-bad-access-crash); i tr...

check if sendsynchronousrequest was successful

hi all i just wanted to know if this is the right way to check if a sendsynchronousrequest was successful: NSData* returnData = [NSURLConnection sendSynchronousRequest:req returningResponse:nil error:nil]; if(returnData == nil) { //code showing an alertView for example } else { //do somthing else } thanks in advance for your ...

how to unzip an image in the iphone code

to unzip an image file sent after gzipping it on the server side i know i have to use gzopen. i want to know if there is a more direct and simple way to do this with 'compressiontype' or something related that once i have the 'zipped image data' received from the server using NSURLconnection can i load an imageview using an easier metho...