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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T08:37:33+00:00 2026-06-12T08:37:33+00:00

I did XML parsing for the content I obtained from WCF Service. I loaded

  • 0

I did XML parsing for the content I obtained from WCF Service. I loaded the data in NSMutableArray using NSXMLParser.Now I want that data to be loaded in tableview in a UIView. But I can see the empty tableview being loaded and data doesn’t. Couldn’t understand where I am going wrong.
My NSMutableArray is like this:

(
    {
   UserName="Roy";
   Password="126";
},
    {
    UserName="Joy";
   Password="123";
},
    {
    UserName="Rony";
   Password="5983";
}
-------------
-------------
)

And the code for UItableView is :

@interface RootViewController : UIViewController<NSXMLParserDelegate,UITableViewDataSource,UITableViewDelegate>
{

  NSMutableArray *arr;
  UITableView *tableView;
}
- (void)viewDidLoad
{
   UITableView* tableView = [[UITableView alloc] initWithFrame:self.view.bounds];
    [self.view addSubview:tableView];    
}
  -(NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
{
    return [arr count];
}
-(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
    static NSString *CellIdentifier=@"Cell";
    UITableViewCell *cell=[tableView dequeueReusableCellWithIdentifier:CellIdentifier];
    if(cell==nil)
    {
        cell=[[[UITableViewCell alloc]initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier]autorelease];
    }
    NSString *tempstring=[arr objectAtIndex:indexPath.row];
    cell.textLabel.text=  tempstring;
    return cell;

}
- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView
{
    return 3;
}   

I am getting empty tableview with some empty rows. How can i fix this?

  • 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-12T08:37:34+00:00Added an answer on June 12, 2026 at 8:37 am

    hey you just add this code in your cellForRowAtIndexPath delegete:-

    EDITED

     -(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
     {
    static NSString *CellIdentifier=@"Cell";
    UITableViewCell *cell=[tableView dequeueReusableCellWithIdentifier:CellIdentifier];
    if(cell==nil)
    {
        cell=[[[UITableViewCell alloc]initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier]autorelease];
    }
    
     SMutableDictionary *d = (NSMutableDictionary *) [arr objectAtIndex:indexPath.row]
    
        UILabel *username = [[UILabel alloc]initWithFrame:CGRectMake(10, 5, 280, 30)];
        username.textColor =DARK_VIEW;
        username.font=[UIFont boldSystemFontOfSize:15];      
        [username setTextAlignment:UITextAlignmentLeft];
    
        [username setText:[d valueForKey:@"UserName"]];
        [cell addSubview:username];
        [username release];
    
        UILabel *Password = [[UILabel alloc]initWithFrame:CGRectMake(11, 25, 280, 30)];
        Password.textColor =DARK_VIEW;
        Password.font=[UIFont fontWithName:@"arial" size:12];        
        [Password setTextAlignment:UITextAlignmentLeft];
    
     [Password setText:[d valueForKey:@"Password"]];
      [cell addSubview:Password];
     [Password release];
    return cell;
    
     }
    
    
    
     - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath 
     {
      SMutableDictionary *d = (NSMutableDictionary *) [arr objectAtIndex:indexPath.row]
            NSString *forNExtViewString =[d valueForKey:@"EmployeID"];
    
    
      objSectonView =[[cntrSecodviewcontroller alloc]initWithNibName:@"cntrSecodviewcontroller" bundle:nil];
            [self.navigationController pushViewController:objSectonView animated:YES];
    
    
    
     }
    
    • 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 xml data received from a web service in
I am parsing xml file from url(in code below), using file_get_contents() function, and simpleXML,
I currently have a script parsing data from a Web Service, all examples I've
I got an error error: Error parsing XML: unbound prefix when i did not
I am using ColdFusion 8. I am parsing an XML document and need to
I am trying to extract some data from an XML input with 6 lines,
I working on xml parsing..... its parsed data success fully . i need to
i have a problem while building and running an iphone application.Im using xml parsing
I want to read a XML file, using XMLReader but the END ELEMENT is
I am parsing xml file from SDcard and display it in textview. whenever i

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.