nsarray - string convert in array Ios , get by webservices -


In iOS I am using XML soap parsing. This is my response

  & Lt; InsertResponse xmlns = "http://OrderMe.solyn.in/" & gt; & Lt; InsertResult & gt; [{"Results": "Success", "AccessToken": "f60da1f1-40d7-483d-880a-82348dc20934", "AppUserId": "35"}]  

Then I am using this code to get the response

  - (zero) parser: (NSXMPP * *) Parser has been found. : (NSString *) string {if (ElementFound) {// NSLog (@ "% @", soap result); [Soap: waste string: string]; If ([Type excelstostring: @ "Insert Response"]) {// --- Recovering the text of an element that is found --- NSLog (@ "% @", string); NSString * str = [[NSString alloc] initWithData: string encoding: NSUTF8StringEncoding]; NSArray * allData = [str JSONValue]; // NSString * loginID = [NSString stringWithFormat: @ "% @", string]; // NSLog (@ "login service is returned from web service:% @", loginID); }}}  

** NSLog (@ "% @", string) in this code; ** This string is printed

  [{Results: "": "Success", "AccessToken": "f60da1f1-40d7-483d-880a-82348dc20934", "ApplicationsIDID": "35 "}]  

So I do not know how to convert it to string in the array I am responding, please share your valuable knowledge. Thank you, Nishant Chandavati.

You need to parse this string as JSON:

  NSString * string = @ "[[\" result \ ": \" success \ ", \" access token \ ": \" f60da1f1-40d7-483d-880a-82348dc20934 \ ", \" AppUserId \ ": \ "35 \"}] "; NSDT * Data = [String Dataupting Encoding: NSUTF8StringEncoding]; NSDictionary * Dyke = [NSJSNSArilization JSONObjectWithData: Data Option: 0 Error: Zero];  

Comments

Popular posts from this blog

java - Can't add JTree to JPanel of a JInternalFrame -

javascript - data.match(var) not working it seems -

javascript - How can I pause a jQuery .each() loop, while waiting for user input? -