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

  • Home
  • SEARCH
  • 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 7993475
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T13:51:36+00:00 2026-06-04T13:51:36+00:00

I am trying to load xml data using newTBXMLWithURL method and once success block

  • 0

I am trying to load xml data using newTBXMLWithURL method and once success block returns xml, I am trying to dispatch it using delegation so that controller receives NSMutableArray of records but I must be doing something wrong and I get an error in console that says “PROGRAM RECEIVED EXC_BAD_ACCESS” I am not sure where I have gone wrong. Code attached below

#import "XmlParser.h"
#import "TBXML+HTTP.h"
#import "NewsObject.h"

@implementation XmlParser
@synthesize  delegate = _delegate;

- (void)GetNewsList
{

    TBXMLSuccessBlock s = ^(TBXML *tbxml) {
        NSMutableArray *arrayOfNews;

        TBXMLElement *root = tbxml.rootXMLElement;

        TBXMLElement *newsListElement = [TBXML childElementNamed:@"NewsList" parentElement:root];

        TBXMLElement *newsElement = [TBXML childElementNamed:@"News" parentElement:newsListElement];

        while(newsElement !=nil){

            NewsObject *news = [[NewsObject alloc]init];

            news.headLine = [TBXML textForElement: newsElement ->firstChild];
            news.description = [TBXML textForElement:newsElement ->firstChild->nextSibling];
            news.imageUrl = [TBXML textForElement:newsElement->firstChild->nextSibling->nextSibling];

            if(arrayOfNews==nil)
                arrayOfNews = [NSMutableArray arrayWithObject:news];
            else
                [arrayOfNews addObject:news];

            newsElement = newsElement ->nextSibling;
        }

        [self.delegate XmlParser:self feedReady:arrayOfNews];
    };

    TBXMLFailureBlock f = ^(TBXML *tbxml, NSError *error) {
        NSLog(@"nay");
    };


    [TBXML newTBXMLWithURL:[NSURL URLWithString:@"url"]
                   success: s
                   failure: f];

}
@end

Input sample:

<xmlData>
<NewsList>
<News newsId="1" providerId="1" articleId="95020" sportId="6" sportName="RBL">
<Headline>Matai signs on with Manly</Headline>
<Description>
Manly has retained another one of its premiership stars with Steve Matai committing to the Sea Eagles until the end of the 2015 season.
</Description>
<Image>
http:google.com/All.png
</Image>
</News>
<News newsId="2" providerId="1" articleId="95019" sportId="7" sportName="RBU">
<Headline>Reds lose Lucas for Brumbies clash</Headline>
<Description>
Queensland has lost key utility back Ben Lucas to injury on the eve of Saturday night's vital match with the Brumbies at Canberra Stadium.
</Description>
<Image>
http:google.com/All.png
</Image>
</News>
</NewsList>
<xmlData>
  • 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-04T13:51:38+00:00Added an answer on June 4, 2026 at 1:51 pm

    Thanks for letting us know the actual error message. There is no a single reason for that error or warning.

    Also, are you using ARC or just forgot to autorelease the stuff? Which Xcode version and compiler are you using? All these details matter.

    I’d say you can fix this avoiding self inside the block:

    __block id _self = self;
    TBXMLSuccessBlock s = ^(TBXML *tbxml) {
        /* use _self inside the block, not self */
    };
    

    See https://stackoverflow.com/a/7854315/143097.

    Previous answer:

    It seems you’re calling a method that doesn’t exist: newTBXMLWithURL:success:failure:. At least in my version of TBXML it is called: tbxmlWithURL:success:failure:.

    I bet there is a hint about this somewhere in the error message, isn’t it?

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

Sidebar

Related Questions

I am trying to load some XML data into C++ code (classes) using gsoap.
I'm facing a rather strange Issue when trying to load data from an XML-Webservice.
I am trying to load a xml document I created using PHP and DOM
i'm trying to insert data into xml using php domdocument. however when i hit
I'm trying to load an external XML file that contains references to images in
I am trying to parse XML using PHP DOM and then insert this data
I am trying to place a repeater within a repeater using xml data. I
I'm trying to load a gzipped XML file using simplexml_load_file() PHP function, but I
I am trying to create an XML file using string data. (Which is itself
I'm getting the error: Illegal characters in path. when trying to load XML, using

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.