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 6625985
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T21:50:24+00:00 2026-05-25T21:50:24+00:00

How can I parse using NSXMLParser if I need all the images, <title>Title</title> <description>my

  • 0

How can I parse using NSXMLParser if I need all the images,

<title>Title</title>
<description>my description is here </description>

<images>

<image>http://www.sosmoths.com/mothImages/800px-Tineola.bisselliella.7218.jpg</image>

<image>http://www.sosmoths.com/mothImages/800px-Tineola.bisselliella.mounted.jpg</image>

<image>http://www.sosmoths.com/mothImages/800px-XN_Tineola_bisselliella_1.jpg</image>

<image>http://www.sosmoths.com/mothImages/Tineola_bisselliella.JPG</image>

</images>

There are more nodes like title, description, so how to parse such xml, I am confused about image nodes, I am thinking to use NSMutableArray for this, but still not clear to do code?

  • 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-25T21:50:24+00:00Added an answer on May 25, 2026 at 9:50 pm
    use this it work
    
    -(void)parser:(NSXMLParser *)parser didStartElement:(NSString *)elementName namespaceURI:(NSString *)namespaceURI qualifiedName:(NSString *)qualifiedName attributes:(NSDictionary *)attributeDict{
        NSLog(@"%@",elementName);
        if([elementName isEqualToString:@"moths"]){
            mytblarray=[[NSMutableArray alloc] init];
        } else if([elementName isEqualToString:@"moth"]){
            tmpdic=[[NSMutableDictionary alloc] init];
        }
        else if([elementName isEqualToString:@"images"]){
            imgArray=[[NSMutableArray alloc] init];
        }
    
    }
    
    -(void)parser:(NSXMLParser *)parser foundCharacters:(NSString *)string{
    
        if(tmpstr!=nil && [tmpstr retainCount]>0){ [tmpstr release]; tmpstr=nil; }
        tmpstr=[[NSString alloc] initWithString:string];
    
    }
    
    -(void)parser:(NSXMLParser *)parser didEndElement:(NSString *)elementName namespaceURI:(NSString *)namespaceURI qualifiedName:(NSString *)qName{
    
        if([elementName isEqualToString:@"moth"]){
            [mytblarray addObject:tmpdic];
            [tmpdic release];
        }if([elementName isEqualToString:@"images"]){
            [tmpdic setValue:imgArray forKey:elementName];
        }
        else if([elementName isEqualToString:@"image"]){
            [imgArray addObject:tmpstr];        
        }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am using NSXMLParser to parse this XML: http://itunes.apple.com/gb/rss/topsongs/limit=50/explicit=true/xml . I am trying to
I can parse an XML file using NSXMLParser . I can also get the
I am usin the nsxmlparser and am wondering how I can parse ISO-8859-1 correctly
I'm using RSS library so i can parse Atom and RSS in Ruby and
How i can parse and extract the parameters from an SQL Query using delphi?
I need a PHP Regex that can parse .strings files. In particular, it needs
I'm using NSXMLParser to parse an rss feed. But I'm getting some strange behavior
As I can parse this query YQL using Jquery. I can not see the
I am using YQL's query.multi to grab multiple feeds so I can parse a
I am currently using NSXMLParser mathods to parse my data something like this :

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.