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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T15:45:26+00:00 2026-06-14T15:45:26+00:00

I need to parse xml string from remote URL, and I want to use

  • 0

I need to parse xml string from remote URL, and I want to use AFNetworking. This is my code:

NSURL *url2 = [NSURL URLWithString:@"REMOTEXMLURL"];
NSURLRequest *request2 = [NSURLRequest requestWithURL:url2];

AFXMLRequestOperation *operation2 = [AFXMLRequestOperation XMLParserRequestOperationWithRequest:request2
                                        success:^(NSURLRequest *request2, NSHTTPURLResponse *response2, NSXMLParser *XMLParser) {
                                            NSLog(@"TESTING PARSING");
                                            [XMLParser setDelegate:self];
                                            [XMLParser parse];
                                        } failure:^(NSURLRequest *request2, NSHTTPURLResponse *response2, NSError *error2, NSXMLParser *XMLParser) {
                                        NSLog(@"%@", [error2 userInfo]);
                                        }];
[operation2 start];

Is it correct? And now that I have *XMLParser, can I avoid to use NSXMLParser delegate methods, like:

-(void)parser:(NSXMLParser *)parser didStartElement:(NSString *)elementName namespaceURI:(NSString *)namespaceURI qualifiedName:(NSString *)qualifiedName attributes:(NSDictionary *)attributeDict

-(void)parser:(NSXMLParser *)parser didEndElement:(NSString *)elementName namespaceURI:(NSString *)namespaceURI qualifiedName:(NSString *)qName

-(void)parser:(NSXMLParser *)parser foundCharacters:(NSString *)string

or I’m constrained to use that? In other words, *XMLParser object initialized with AFNetworking and AFXMLRequestOperation must be passed to delegate methods, or can I parse it in another way (like AFJSONRequestOperation, into AFNetworking operation)? Thank you!

  • 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-06-14T15:45:27+00:00Added an answer on June 14, 2026 at 3:45 pm

    The NSXMLParser needs a delegate. If you want to use NSXMLParser, and want your class to be its delegate, you need to implement the delegate methods to make sense of your XML.

    The XML parser doesn’t know what the meaning of your XML is, it just reads it to you; you have to understand it yourself.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I need to parse a XML String so I can use some of the
i need to parse this php xml response in android: <?phpxml version=1.0 encoding=utf-8?> <SmsResponse>
I need to parse a value from an xml and place it to image's
I need to parse XML string with Linq, and I came up with the
I'm receiving XML sent via POST. Naturally I need to parse this XML to
I need to parse a XML file which I get from third party to
guys i have an xml in an URL and i need to parse that
I ran into a problem while trying to parse an XML string returned from
I am getting this error while trying to Parse the Xml response from the
I don't need to parse the XML, or to decode it into an ActionScript

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.