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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T17:52:09+00:00 2026-05-27T17:52:09+00:00

In my tableview i have set xml data to display but until scroll it

  • 0

In my tableview i have set xml data to display but until scroll it does not display all value. I have reloaded the tableview when i am getting my xml data. I also used [cell.contenView viewWithTag:tagnumber]; But still now its not Working…please help me anybody….

Data are coming and using NSLog i can get the value but not display until scroll.
One think i have to mention that i can see the my cellview and imageview but not showing lable data.

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

static NSString *MyIdentifier = @"MyIdentifier";
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:MyIdentifier];
if (cell == nil) {
    //cell = [[[UITableViewCell alloc] initWithFrame:CGRectZero reuseIdentifier:MyIdentifier] autorelease];
    cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault  reuseIdentifier:MyIdentifier] autorelease];
    cell.textLabel.font = [UIFont fontWithName:@"Helvetica" size:15.0];
    cell.selectionStyle = UITableViewCellSelectionStyleBlue;

    UIImageView *imageView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"arrow.png"]];
    cell.accessoryView = imageView;
    tableView.separatorColor = [UIColor clearColor];
    tableView.separatorStyle = UITableViewCellSeparatorStyleSingleLine;

          // THIS IS A VIEW ABOVE MY CELL NAME: cellView    

    cellView = [[[UIView alloc] initWithFrame:CGRectMake(0,0,290, 120)] autorelease];
    cellView.backgroundColor = [UIColor colorWithPatternImage:[UIImage imageNamed:@"order_description_bg.png"]];
    cellView.tag =10;

         // THIS IS A IMAGEVIEW ABOVE MY cellView NAME: imgView

    imgView = [[UIImageView alloc] initWithFrame:CGRectMake(10, 15, 39, 36)];
    imgView.image = [UIImage imageNamed:@"order_image.png"];
    imgView.layer.borderColor = [UIColor blackColor].CGColor;
    imgView.layer.borderWidth = 0.0f;
    imgView.tag = 5;

           // THIS IS A LABEL ABOVE MY cellView NAME: statusLabel

            CGRect statusRect = CGRectMake(65, 0, 190, 18);
    statusLabel = [[[UILabel alloc] initWithFrame:statusRect] autorelease];
    statusLabel.textAlignment = UITextAlignmentLeft;
    statusLabel.textColor = [UIColor blackColor];
    statusLabel.font = [UIFont systemFontOfSize:12];
    statusLabel.backgroundColor = [UIColor greenColor];
    statusLabel.tag = 1;

    [cell.contentView addSubview:cellView];
    [cellView addSubview:statusLabel];
    [cellView addSubview:imgView];

}


  //  [cell.contentView superview];
cellView = (UIView *)[cell.contentView viewWithTag:10];
imgView = (UIImageView *)[cellView viewWithTag:5];
statusLabel = (UILabel *)[cellView viewWithTag:1];

if(searching == YES && x<=inumOfRowAfterSearch){
        NSLog(@"[[searchData objectAtIndex:m] intValue] is : %d",[[searchData objectAtIndex:inumOfRowAfterSearch] intValue]);
            y = [[searchData objectAtIndex:inumOfRowAfterSearch] intValue];

    cellView = (UIView *)[cell.contentView viewWithTag:10];
    imgView = (UIImageView *)[cellView viewWithTag:5];
    statusLabel = (UILabel *)[cellView viewWithTag:1];

    if(pendingOrder == NO && todaysOrder == NO && x<=inumOfRowAfterSearch){
        statusLabel.text = [NSString stringWithFormat:@"Status: %@",[[records objectAtIndex:y] objectAtIndex:1]];
     }
    else if(pendingOrder == YES && todaysOrder == NO && x<=inumOfRowAfterSearch){
        statusLabel.text = [NSString stringWithFormat:@"Status: %@",[[records objectAtIndex:y] objectAtIndex:1]];
    }
}
else{

    cellView = (UIView *)[cell.contentView viewWithTag:10];
    imgView = (UIImageView *)[cellView viewWithTag:5];
    statusLabel = (UILabel *)[cellView viewWithTag:1];

    if(pendingOrder == NO && todaysOrder == NO){
      statusLabel.text = [NSString stringWithFormat:@"Status: %@",[[records objectAtIndex:indexPath.section] objectAtIndex:1]];
        NSLog(@"status lable value: %@",statusLabel.text);
        }
    else if(pendingOrder == YES && todaysOrder == NO){
        statusLabel.text = [NSString stringWithFormat:@"Status: %@",[[pendingRecords objectAtIndex:indexPath.section] objectAtIndex:1]];
        }
}
return cell;
}

Before scroll the table.

enter image description here

After Scroll the tableview

enter image description here

  • 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-27T17:52:10+00:00Added an answer on May 27, 2026 at 5:52 pm

    Following codes are not necessary in each condition , since you have written the code outside of the condition. It seems duplicate.

    cellView = (UIView *)[cell.contentView viewWithTag:10];
    imgView = (UIImageView *)[cellView viewWithTag:5];
    statusLabel = (UILabel *)[cellView viewWithTag:1];
    

    And coming to your question, it seems initially it skips both if and else if conditions. Comment also the NSLogs and write NSLog in else part of the conditions.

    Edit:

    //  [cell.contentView superview];
    cellView = (UIView *)[cell.contentView viewWithTag:10];
    imgView = (UIImageView *)[cellView viewWithTag:5];
    statusLabel = (UILabel *)[cellView viewWithTag:1];
    
    if(searching == YES && x<=inumOfRowAfterSearch){
        NSLog(@"[[searchData objectAtIndex:m] intValue] is : %d",[[searchData objectAtIndex:inumOfRowAfterSearch] intValue]);
        y = [[searchData objectAtIndex:inumOfRowAfterSearch] intValue];
    
        if(pendingOrder == NO && todaysOrder == NO ){
            statusLabel.text = [NSString stringWithFormat:@"Status: %@",[[records objectAtIndex:y] objectAtIndex:1]];
        }
        else if(pendingOrder == YES && todaysOrder == NO ){
            statusLabel.text = [NSString stringWithFormat:@"Status: %@",[[records objectAtIndex:y] objectAtIndex:1]];
        }
        else
        {
            statusLabel.text = [NSString stringWithFormat:@"Status: None"];
        }
    }
    else{
        if(pendingOrder == NO && todaysOrder == NO){
            statusLabel.text = [NSString stringWithFormat:@"Status: %@",[[records objectAtIndex:indexPath.section] objectAtIndex:1]];
            NSLog(@"status lable value: %@",statusLabel.text);
        }
        else if(pendingOrder == YES && todaysOrder == NO){
            statusLabel.text = [NSString stringWithFormat:@"Status: %@",[[pendingRecords objectAtIndex:indexPath.section] objectAtIndex:1]];
        }
        else
        {
            statusLabel.text = [NSString stringWithFormat:@"Status: None"];
        }
    }
    return cell;
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a UITableViewController. In viewDidLoad I set the rowHeight: self.tableView.rowHeight = 43; But
I'm developing an iPhone application which uses a TableView to display XML data. The
So, I have a UITableView set up to display all the system languages, where
I have a set of data created by another app and stored in XML
I have a tableView which has cells with phone numbers. The app is not
i have a tableview application loaded with core data feltching objects and i wanna
I have xml data that is retrieved from a server and I need to
I have set the size of the tableView that I show as the popoverController
In the following code, I have determined that everything works, up until [tableView reloadData]
I have a TableView loading a custom cell and loading the data from a

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.