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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T00:57:29+00:00 2026-06-07T00:57:29+00:00

In my app i’m using TBXML parser where i need to get a value

  • 0

In my app i’m using TBXML parser where i need to get a value from xml file and print it on the label…This is my xml file in server

 <gold>
 <price>
 <title>22 K Gold</title>
 </price>
 <price>
 <title>24 K Gold</title>
 </price>
 </gold>

any my Viewcontroller.h looks like

#import <UIKit/UIKit.h>
#import "TBXML.h"

 @interface ViewController : UIViewController{

IBOutlet UILabel *lab;
TBXML *tbxml;
}



@end

and my Viewcontrooler.m looks like

 - (void)viewDidLoad
{
[super viewDidLoad];
// Do any additional setup after loading the view, typically from a nib.
NSData *xmlData = [[NSData alloc]initWithContentsOfURL:[NSURL URLWithString:@"http://www.abcde.com/sample.xml"]];
 tbxml = [[TBXML alloc]initWithXMLData:xmlData];


TBXMLElement * root = tbxml.rootXMLElement;

if (root)
{
    TBXMLElement * elem_PLANT = [TBXML childElementNamed:@"price" parentElement:root];
    while (elem_PLANT !=nil)
    {
        TBXMLElement * elem_BOTANICAL = [TBXML childElementNamed:@"title" parentElement:elem_PLANT];
        NSString *botanicalName = [TBXML textForElement:elem_BOTANICAL];
        lab.text=[NSString stringWithFormat:@"re %@", botanicalName];

        elem_PLANT = [TBXML nextSiblingNamed:@"price" searchFromElement:elem_PLANT]; 

        elem_BOTANICAL = [TBXML childElementNamed:@"title" parentElement:elem_PLANT]; 

        botanicalName = [TBXML textForElement:elem_BOTANICAL];
        lab1.text=[NSString stringWithFormat:@"re %@", botanicalName];
    }
}

}

i’m getting BAD_ACCESS thread.Am i missing anything…Help pls…

  • 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-07T00:57:30+00:00Added an answer on June 7, 2026 at 12:57 am
    lab.text=[NSString stringWithFormat:@"re %@",elem_BOTANICAL];
    

    Edit 1.0:

    lab.text=[NSString stringWithFormat:@"re %@", botanicalName];
    

    Edit 2.0:

    lab.text=[NSString stringWithFormat:@"re %@", botanicalName];
    
    NSString *plantName = [TBXML textForElement: elem_PLANT];
    
    lab1.text=[NSString stringWithFormat:@"re %@", plantName];
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

My app uses a WebRequest at certain points to get pages from itself. This
app.get('/', function (req, res) { res.render('home.jade', { results: req.session.value }); }); What i would
My app needs to be able to disconnect from a server and connect to
app/assets/stylesheets/application.css *= require formtastic I get this error: rake assets:precompile /Users/Nerian/.rvm/rubies/ruby-1.9.3-rc1/bin/ruby /Users/Nerian/.rvm/gems/ruby-1.9.3-rc1@davinci/bin/rake assets:precompile:all RAILS_ENV=production
App.config: <?xml version=1.0 encoding=utf-8 ?> <configuration> <appSettings> <add key=1 value=An error occured.\r\nPlease try again
App A has this BroadcastReceiver in its manifest (within <application>): And this receiver: public
My app is crashing using iOS5 and iOS4.3 iPhone simulators in Xcode 4.2, the
My app is slowed down by N+1 queries. I'm using the will_paginate gem with
app.get('/',function(req,res){ res.render('home'); // I want the template to be able to access the flash
We're building an app, our first using Rails 3, and we're having to build

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.