-(BOOL) Application: (UIApplication *) application didfinishlaunchingwithoptions: (nsdictionary *) launchOptions{ [self test]; //Override point for customization after application Launch. return YES;} -(void) Test { //xml Text Example nsstring * testxmlstring = @ "Cake0.55regularchocolateblueberrynoneglazedsugar"; nslog (@ "XML string[\n%@\n]", testxmlstring); //parsing XML is nsdictionary nserror *parseerror = nil; nsdictionary *xmldictionary = [XMLReader dictionaryforxmlstring:testxmlstring error:&parseerror]; //Print NSDictionary nslog (@ "%@", xmldictionary); // Nsdictionary conversion to data nsdata* jsondata = [Nsjsonserialization datawithjsonobjecT:xmldictionary options:nsjsonwritingprettyprinted error:&parseerror]; //data converted to json nsstring* str = [[NSString alloc] initwithdata:jsondata encoding: Nsutf8stringencoding]; nslog (@ "JsonData string[\n%@\n]", str); //character Group converted to nsdictionary nsdictionary *jsondict = [str Objectfromjsonstring]; //nsdictionary Convert to XML plist format nsdata *xmldata = [Nspropertylistserialization datafrompropertylist:jsondict format:nspropertylistxmlformat_v1_0 errorDescription:NULL]; //data converted to NSString output encoded as Utf-8 nslog (@ "XML:%@", [[NSString alloc] Initwithdata:xmldata encoding:nsutf8stringencoding]); nslog (@ "%@", [XMLWriter xmlstringfromdictionary:jsondict withheader:no]);  } //uses three class libraries, respectively, for 1,jsonkit https://github.com/johnezang/jsonkit2 , XMLWriter https://github.com/ahmyi/xmlwriter3,xmlreader https://github.com/ amarcadet/xmlreader SOURCE:http://download.csdn.net/download/p709723778/5725585 The following connection is XML converted to dictionaryhttps://github.com/ nicklockwood/xmldictionaryhttp://download.csdn.net/detail/p709723778/6706331
iOS development----Nsdictionary,json and XML conversions