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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T23:51:15+00:00 2026-05-30T23:51:15+00:00

I created a custom cell. When I use these custom cells in table view

  • 0

I created a custom cell. When I use these custom cells in table view My cells getting replaced.I created about 10 sections in the table view in which each section contains 1 row. I am using Custom Cells for all 10 sections. When I scroll the view, the last 4 cells are replaced with top cells. I am using ReuseIdentifier but they are still getting replaced. Any Ideas to fix this? Thanks!

This is my CustomCell Code!

-(UITableViewCell *)returnCellForBirthdayDetails:(UITableView *)tableView
{
    UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"CustomCellForBirthdayDetails"];

    if(cell == nil)
    {
        [[NSBundle mainBundle] loadNibNamed:@"CustomCellToAddDetails" owner:self options:nil];
        cell = customCell;
        //        customCell = nil;
    }

    return  cell;
}
-(BOOL)textFieldShouldReturn:(UITextField *)textField
{
    [customCellTextField resignFirstResponder];
    return YES;
}

- (UITextField *)textField
{
    UITextField *textField = nil;

    if( customCell )
    {
        textField = (UITextField *)[customCell.contentView viewWithTag:101];
    }

    return textField;
}

and Here I am calling custom cells in the tableView

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
      UITableViewCell *cell = nil;

    AppDelegate *delegate = (AppDelegate *)[[UIApplication sharedApplication] delegate];
     addCustomCell  = [[CustomCellToAddDetailsController alloc] init];

    switch (indexPath.section) 
    {
        case 0:
            cell = [addCustomCell returnCellForBirthdayDetails:tableView];
            addCustomCell.customCellLabel.text = @"FirstName";
            addCustomCell.customCellLabel.font = [UIFont boldSystemFontOfSize:12];
            addCustomCell.customCellTextField.placeholder = @"FirstName";
            [delegate.fieldArray addObject:addCustomCell];
            break;
        case 1:
            cell = [addCustomCell returnCellForBirthdayDetails:tableView];
            addCustomCell.customCellLabel.text = @"LastName";
            addCustomCell.customCellLabel.font = [UIFont boldSystemFontOfSize:12];
            addCustomCell.customCellTextField.placeholder = @"LastName";
            [delegate.fieldArray addObject:addCustomCell];
            break;
        case 2:
            cell = [addCustomCell returnCellForBirthdayDetails:tableView];
            addCustomCell.customCellLabel.text = @"Dob";
            addCustomCell.customCellLabel.font = [UIFont boldSystemFontOfSize:12];
            addCustomCell.customCellTextField.placeholder = @"Dob";
            addCustomCell.customCellTextField.inputView = dp;
            addCustomCell.customCellTextField.inputAccessoryView=toolBarForTableView;
            [delegate.fieldArray addObject:addCustomCell];
            break;
        case 3:
            cell = [addCustomCell returnCellForBirthdayDetails:tableView];
            addCustomCell.customCellLabel.text = @"Address";
            addCustomCell.customCellLabel.font = [UIFont boldSystemFontOfSize:12];
            addCustomCell.customCellTextField.placeholder = @"Enter Address";
            [delegate.fieldArray addObject:addCustomCell];
            break;
        case 4:
            cell = [addCustomCell returnCellForBirthdayDetails:tableView];
            addCustomCell.customCellLabel.text = @"City";
            addCustomCell.customCellLabel.font = [UIFont boldSystemFontOfSize:12];
            addCustomCell.customCellTextField.placeholder = @"Enter City";
            [delegate.fieldArray addObject:addCustomCell];
            break;
        case 5:
            cell = [addCustomCell returnCellForBirthdayDetails:tableView];
            addCustomCell.customCellLabel.text = @"State";    
            addCustomCell.customCellLabel.font = [UIFont boldSystemFontOfSize:12];
            addCustomCell.customCellTextField.placeholder = @"Enter State";
            [delegate.fieldArray addObject:addCustomCell];
            break;
        case 6:
            cell = [addCustomCell returnCellForBirthdayDetails:tableView];
            addCustomCell.customCellLabel.text = @"Email";
            addCustomCell.customCellLabel.font = [UIFont boldSystemFontOfSize:12];
            addCustomCell.customCellTextField.placeholder = @"Enter Email";
            [delegate.fieldArray addObject:addCustomCell];
            break;
        case 7:
            cell = [addCustomCell returnCellForBirthdayDetails:tableView];
            addCustomCell.customCellLabel.text = @"Phone";
            addCustomCell.customCellLabel.font = [UIFont boldSystemFontOfSize:12];
            addCustomCell.customCellTextField.placeholder = @"Enter MobileNo";
            [delegate.fieldArray addObject:addCustomCell];
            break;
    }
    return cell;
    [addCustomCell release];

}

Please let me know what mistake I am making. Thanks!!

  • 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-30T23:51:17+00:00Added an answer on May 30, 2026 at 11:51 pm

    Use a different reuseIdentifier for each cell. When you use the same identifier, then the tableview will just grab any available cell with this identifier (in your case it’s grabbing the top ones since they are no longer in use).

    Edit:
    You can use the same identifier (and you should) for cells that are identical in everything except text/image. Then you can call a ‘configureCell’ method where you set the text/image/etc for each cell.

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

Sidebar

Related Questions

I have several parts in my app where I use custom table view cells.
I have created a custom view cell with a UILabel in it, I have
I am implementing a tab;e in which i have created a custom cell for
i am working on one application in which i have created one table view
I have created custom MembershipUser, MembershipProvider and RolePrivoder classes. These all work and I
I have a custom UITableViewCell which is part of a navigation controller. The cell
I have created a custom UITableViewCell , but when I dequeue the cell, sometimes
I have a custom UITableViewCell which I created in Interface Builder. I am successfully
I need to use custom cell renderer for my JTree to add some JLabel
I'm reading a custom table cell in tableView:cellForRowAtIndexPath: from a nib file. This works

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.