NSDictionary to XML

AcerceIncarly

New Member
I'm trying to convert a NSDictionary to XML. (I was successful in transforming NSDictionary to JSON). But now I need to transform NSDictionary to XML. Is there a built-in serializer in Objective-C like the one for JSON?\[code\]int r = arc4random() % 999999999;//simulate my NSDictionary (to be turned into xml)NSString *name = [NSString stringWithFormat:mad:"Posted using iPhone_%d", r];NSString *stock_no = [NSString stringWithFormat:mad:"2342_%d", r];NSString *retail_price = @"12345";NSArray *keys = [NSArray arrayWithObjects:mad:"name", @"stock_no", @"retail_price", nil];NSArray *objects = [NSArray arrayWithObjects:name,stock_no,retail_price, nil];NSDictionary *theRequestDictionary = [NSDictionary dictionaryWithObjects:eek:bjects forKeys:keys];NSDictionary *theFinalRequestDictionary = [NSDictionary dictionaryWithObject:theRequestDictionary forKey:mad:"product"];\[/code\]...//other irrelevant code omitted\[code\]NSData *theBodyData = http://stackoverflow.com/questions/9125441/[NSPropertyListSerialization dataFromPropertyList:theFinalRequestDictionary format:NSPropertyListXMLFormat_v1_0 errorDescription:nil];NSPropertyListFormat format;id XMLed = [NSPropertyListSerialization propertyListFromData:theBodyData mutabilityOption:NSPropertyListImmutable format:&format errorDescription:nil];NSLog(@"the XMLed is this: %@", [NSString stringWithFormat:mad:"%@", XMLed]);\[/code\]The NSLog doesn't print a string in XML format. It prints it like a NSDictionary.What should I use to serialize my NSDictionary to XML?
 
Top