Getting info from NSData object

Posted by Moshe on Stack Overflow See other posts from Stack Overflow or by Moshe
Published on 2010-03-17T13:02:17Z Indexed on 2010/03/17 13:11 UTC
Read the original article Hit count: 343

How would I get returningResponse (into say, a NSString) from the following code:

NSURLResponse* response;
NSError* error;
NSData* result = [NSURLConnection sendSynchronousRequest:theRequest returningResponse:&response error:&error];

I think I can get the info that I need into a string but I can't call anything on response because it's null. Therefore, I assume that I need to call something on result. The problem is, I don't know what to call.

(The URL request has been coded prior to the code sample. I know that that works.) I want to be able to detect if the request as successful.

© Stack Overflow or respective owner

Related posts about objective-c

Related posts about iphone-sdk