Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6082997
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T11:21:05+00:00 2026-05-23T11:21:05+00:00

Hi guys i have little weird problem. I am using a simple XML to

  • 0

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.i can see the text node value when i print NSdictionary

here is the plist screenshot.

enter image description here

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);
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T11:21:05+00:00Added an answer on May 23, 2026 at 11:21 am

    I don’t think your plist files 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 @"".

    testXMLString = [testXMLString stringByReplacingOccurrencesOfString:@"\n" withString:@""];
    

    Better Trimming

    As such replacing tabs (\t) seems to render the string unreadable by the XMLReader. So to fix this, it would be easier the change the XMLReader code to insert trimmed values into the dictionary.

    In the method parser:didEndElement:namespaceURI:qualifiedName:, replace

    [dictInProgress setObject:textInProgress forKey:kXMLReaderTextNodeKey];
    

    with

    NSString * trimmedString = [textInProgress stringByTrimmingCharactersInSet:[NSCharacterSet characterSetWithCharactersInString:@"\n\t"]];
    [dictInProgress setObject:trimmedString forKey:kXMLReaderTextNodeKey];
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Hey guys, I have a little problem with a simple ajax request. I can't
Guys i have a little problem when i submit my form the page gets
Guys i have a little problem, i tried to find some examples on GeoIP
Hey guys! I have this little problem: I have one ViewController which adds 2
Hay guys, im making a simple car sale website. I have a nice little
Hey guys I have a little issue here. I have a panel where I
Thus far you guys have been wildly helpful with me getting this little ditty
Hi guys I have a weird question, I have a cli php script runs
I've got yet another deployment problem. What I have: little Windows Forms application that
I have a little problem; I have this protocol defined as so below: @protocol

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.