Sunday 15 April 2012

nsurlrequest - NSURLErrorDomain Code = -1012 error -


I am trying to log in to a server, but I am getting an error request to use SSJSNN in JSON To convert, and to convert it back to JSON from string, and I'm using a method to create all of my API calls. I have looked around for a solution, but I can not find any one here, the method I use to login:

  + (zero) requestFromUrl: (NSString * ) UrlString withType: (NSString *) type with BD: (NSDictionary *) dict {NSURL * url = [NSD URL URL with string: url string]; NSMutableURL request * request = [NSMutableURL request request withURL: url]; [Setup HTTP: type]; If (dict) {NSString * jsonString = [dict JSON report]; NSData * jsonData = [jsonString DataUsing Encoding: NSASCIIStringEncoding Allow Loansy Conversion: True]; [Request Set Value: @ "App / Jason" HTTP Headerfield: @ "Content-Type"]; [Request set httpbb: jssadata]; } NSOperationQueue * queue = [[NSOperationQueue alloc] init]; [NSURLConnection sendAsynchronousRequest: Request queue: queue terminationHandler: ^ (NSURLResponse * response, NSData * data, NSError * error) {if (error) {NSLog (@ "Error retrieving data:% @", error.description); } Other {id results = [data JSONValue]; NSLog (@ "Received Feedback:% @", Results); [[NSNotificationCenter defaultCenter] postNotificationName: @ "Response object received: Self user info: result];}}];   

Can anyone help me? < / Div>

Create it: NSDTa * JSNET Data = [JasonString Data Wrapping Encoding: Allow NSAIDItiting Encoding Losy conversion: true];

In:

  NSDTata * JSNDT = [jsonString data wrapping encoding: NSUTF8StringEncoding];   

No comments:

Post a Comment