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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T04:59:05+00:00 2026-05-26T04:59:05+00:00

Please can any one correct my silly mistake as i am unable to show

  • 0

Please can any one correct my silly mistake as i am unable to show my parsed XML to the Table view.

I want my tag to be displayed on table view.
here is my code (ignore my syntax … as i am unable to paste it correctly here)….

XML TO BE PARSED

<Table><category><Name>Books</Name><cid>2</cid><Logo>http://litofinter.es.milfoil.arvixe.com/Thumbnail/5.png</Logo><Product><pid>55</pid><Title>Un producto para cada necesidad</Title><Thumbnail>http://litofinter.es.milfoil.arvixe.com/Thumbnail/Book3.png</Thumbnail><pdf>http://litofinter.es.milfoil.arvixe.com/PDF/Book6.pdf</pdf></Product><Product><pid>58</pid><Title>Quitamanchas pistola</Title><Thumbnail>http://litofinter.es.milfoil.arvixe.com/Thumbnail/Book9.png</Thumbnail><pdf>http://litofinter.es.milfoil.arvixe.com/PDF/Book7.pdf</pdf></Product></category></Table>

CODE

#TABLEVIEWCONTROLLER.H:


@class Book;

@interface TableViewController : UIViewController<UITableViewDataSource,UITableViewDelegate> {

    IBOutlet UIButton *btnBack;
    IBOutlet UITableView *tableView;
    Book *bookOne;
    NSMutableArray *array;
}

-(IBAction)onTapBack;

@property (nonatomic, retain)IBOutlet UITableView *tableView;


@end

#TABLEVIEWCONTROLLER.M

import "TableViewController.h"
import "XMLTableAppDelegate.h"
import "Book.h"

@implementation TableViewController


@synthesize tableView;

-(IBAction)onTapBack
{
    UIAlertView *alert = [[UIAlertView alloc]initWithTitle:@"Message from mAc" message:@"Trail" delegate:self cancelButtonTitle:@"Cancel" otherButtonTitles:@"Ok",nil];
    [alert show];
}


- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
{
    return [array count];
}

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{

    UITableViewCell *cell = [[UITableViewCell alloc]initWithStyle:UITableViewCellStyleDefault reuseIdentifier:nil];
    cell.accessoryType = UITableViewCellAccessoryDisclosureIndicator;
    cell.selectionStyle = UITableViewCellSelectionStyleBlue;
    Book *book = [[Book alloc]init];
    book = [array objectAtIndex:indexPath.row];

    cell.textLabel.text = book.arrayString;
    [book release]; 
    [cell autorelease];
    return cell;
}


// Implement viewDidLoad to do additional setup after loading the view, typically from a nib.
- (void)viewDidLoad {
    [super viewDidLoad];

    tableView.delegate = self;
    tableView.dataSource = self;

    //bookOne = [[Book alloc]init];
    array = [[NSMutableArray alloc]init];
    [array addObject:@"mAc"];
    [array addObject:@"Mayank"];
    [array addObject:@"Manu"];

}

-(void)viewWillAppear:(BOOL)animated{

    [tableView reloadData];
}



- (void)dealloc {
    [super dealloc];
    [tableView release];
    [btnBack release];
}

#BOOK.h


@interface Book : NSObject {


    NSMutableString *arrayString;

}

@property(nonatomic,retain) NSMutableString *arrayString;

@end

#BOOK.M

import "Book.h"


@implementation Book

@synthesize arrayString;

-(void)dealloc
{
    [super dealloc];

    [arrayString release];
}

@end
  • 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-26T04:59:06+00:00Added an answer on May 26, 2026 at 4:59 am
    1. You shouldn’t alloc+init memory for Book and don’t release it : [book release];
    2. Your array contains objects of class NSString : [array addObject:@"mAc"];
    3. Try to set value using next line: cell.textLabel.text = [array objectAtIndex:indexPath.row];
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

1)Can Any one please tell me what are the prerequisites have been installed on
Can any one please tell me how to set notifications for different values at
Can any one please help me how to go to another activity in android
Can any one please tell me the difference between target and currenttarget in flex?
can any one please tell me how to get the Google places api key
Can any one please help me solve this. I am resizing some flash object/embed
Please can anyone one point me to a good tutorial that helps me to
Can someone please correct me, I've found this example online and bunch of others
Can someone please evaluate my code and let me know if it is correct.
Can somebody please tell me how I can determine which tabbar index a view

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.