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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T05:35:08+00:00 2026-05-30T05:35:08+00:00

I have UITableView with Custom View on it. For the bottom of the tableview,

  • 0

I have UITableView with Custom View on it.
For the bottom of the tableview, I add a “Load More” cell there.
After clicked, the tableview load more data successfully and the “Load More” cell still at the bottom of the tableview.
However, after I clicked the first “Load More”, the second “Load More” appears, and the custom view still exist in the same cell of second “Load More”. “Load More” and custom view are on the same cell. I want that cell only appear “Load More”.

This problem exists for the third, fourth “Load More”.
Can anyone help me?

- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section{
        return imageCurPos+1;
}
- (UITableViewCell *)tableView:(UITableView *)aTableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
    if([aTableView tag]==501){ 
        // Main Table
        static NSString *CellIdentifier = @"Cell";
        UITableViewCell *cell = [aTableView dequeueReusableCellWithIdentifier:CellIdentifier];
        [[cell viewWithTag:3007] removeFromSuperview];

        const NSInteger BOTTOM_LABEL_TAG = 3002;
        UIImageView *bottomLabel;
        UILabel *loadMore;


        if(indexPath.row < imageCurPos){
        if (cell == nil)
        { //All repeat things come here, if don't want to repeat here, please state outside this brucket
            cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier] autorelease];
        }

//Edited
for (UIView *view in [cell.contentView subviews]) 
    {
        [view removeFromSuperview];
    }


            bottomLabel = [[[UIImageView alloc] initWithFrame: CGRectMake(50, 30, 250, 112)] autorelease];
            [cell.contentView addSubview:bottomLabel];

            bottomLabel.tag = BOTTOM_LABEL_TAG;

            cell.backgroundView =
            [[[UIImageView alloc] init] autorelease];
            cell.selectedBackgroundView =
            [[[UIImageView alloc] init] autorelease];

        UIImageView *iconView = [[[UIImageView alloc] initWithFrame:CGRectMake(0, 30, 45, 45)] autorelease];
        iconView.image = [UIImage imageNamed:@"02_bubble.png"];
        [[cell contentView] addSubview:iconView];

        bottomLabel.image = [UIImage imageNamed:@"05_bubble.png"];

        }else if(indexPath.row == imageCurPos ){ //For Load More
            if (cell == nil)
            { //All repeat things come here, if don't want to repeat here, please state outside this brucket
                cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier] autorelease];
            }  

//Edited
for (UIView *view in [cell.contentView subviews]) 
    {
        [view removeFromSuperview];
    }


                loadMore =
                [[[UILabel alloc]
                  initWithFrame:
                  CGRectMake( 0, 0, 300, 50)]
                 autorelease];

                loadMore.text = @"Load more...";
                loadMore.textAlignment = UITextAlignmentCenter;

                loadMore.tag = 3007;

                loadMore.textColor = [UIColor whiteColor];
                loadMore.backgroundColor = [UIColor darkTextColor];
                [cell.contentView addSubview:loadMore];            
        }
        return cell;     
    }
}

- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *) indexPath{
if([tableView tag]==501){
        if([indexPath row] != imageCurPos){

        }else{ // For load more

            NSLog(@"noRow Prev: %d", imageCurPos);
            imageCurPos += interval;
            NSLog(@"noRow After: %d", imageCurPos);

            [tbl_mo_main reloadData];   
        }
}
  • 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-30T05:35:10+00:00Added an answer on May 30, 2026 at 5:35 am

    I think you should use 2 different identifiers, one for the normal cell and one for load more cell.

    And one thing is that creating custom cell should be done in the block.

    if (cell == nil)  {
        cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier] autorelease];
    
        //  create the views in side the cell and add it
        ...
    }
    

    Then outside this block, update the cell.
    You can set the tag for your views in the creation of cell, and update the corresponding view by getting it with [cell.contentView viewWithTag:tag]

    You may refer to this topic: Reload TableViewCell's UILabels in dynamic table

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

Sidebar

Related Questions

Currently I have a UITableView with custom cells and in each cell there is
I have a UITableView and I am adding custom view to the cell. It
I have a UITableView whose cells contain custom ImageViews that asynchronously load the images
I have a custom UITableView cell which has a button and a label. I
I have a UITableview made up with a custom cell loaded from a nib.
I have a table view with a custom cell (governed by a custom class
I made a very simply table view, with load more function. I have added
in app i have custom tableview(UITableView *tableView) which subclass of uiviewcontroller & in tableview
I have a UITableView with custom UITableViewCells. Each cell asynchronously loads an image and
UITableView custom cell showing weird results? I have my code below. Everything was showing

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.