Hi guys i have little weird problem. I am using a simple XML to NSDictionary converter
http://troybrant.net/blog/2010/09/simple-xml-to-nsdictionary-converter/
and but if print the NSDictionary , i can see the text value for the node but if i store it in plist, text node will not have any string value. see attach images.
here is the plist screenshot.

here is the code
NSURL * URL = [[NSURL alloc]initWithString:@"rss feed link "];
NSData * data = [[NSData alloc] initWithContentsOfURL:URL];
NSString *testXMLString = [[NSString alloc]initWithData:data encoding:NSUTF8StringEncoding];
// Parse the XML into a dictionary
NSError *parseError = nil;
NSDictionary *xmlDictionary = [XMLReader dictionaryForXMLString:testXMLString error:&parseError];
NSString * filepath = [self dataFilePathwithFilename:[NSString stringWithFormat:@"TEST.plist"]];
[xmlDictionary writeToFile:filepath atomically:YES];
// Print the dictionary
NSLog(@"%@", xmlDictionary);
I don’t think your
plistfiles have empty values. You are just not accounting for the new line character in the highlight text in your first image ("\n\thttp://wordpress.org/?v=3.0.1").One easy way of verifying this would be to open it using a text editor. You will find that the values are there. You can also navigate to that field in the property list editor and press the down button.
Replacing the newline characters
Use
stringByReplacingOccurrencesOfString:withString:method to replace all newline characters with@"".Better Trimming
As such replacing tabs (
\t) seems to render the string unreadable by theXMLReader. So to fix this, it would be easier the change theXMLReadercode to insert trimmed values into the dictionary.In the method
parser:didEndElement:namespaceURI:qualifiedName:, replacewith