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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T12:29:42+00:00 2026-05-12T12:29:42+00:00

I added several cells to a tableview and each cell has a textField in

  • 0

I added several cells to a tableview and each cell has a textField in the right to let users input texts. I find that when I scroll down and go back, the input of the first few lines will disappear. Does anybody know what’s the problem?

The following is a piece of my codes:

-(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath
    *)indexPath
        {
            //init cell
            static NSString *TableIdentifier = @"MyIdentifier";
            UITableViewCell *cell = (UITableViewCell *)[tableView dequeueReusableCellWithIdentifier:TableIdentifier];
            if(cell == nil) {
                cell = [[[UITableViewCell alloc] initWithFrame:CGRectZero 
                                        reuseIdentifier:TableIdentifier] autorelease];
            }

            //set cell for each row
            if([indexPath row] == 0)
            {
                cell.textLabel.text = @"Row A";
                txt_A = [self CreateTextField];         //create textField
                [cell.contentView addSubview:txt_A];        //add textField to cell
            }
            else if([indexPath row] == 1)
            {
                cell.textLabel.text = @"Row B";
                    txt_B = [self CreateTextField];
                    [cell.contentView addSubview:txt_B];
            }
            else{...} }
  • 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-12T12:29:42+00:00Added an answer on May 12, 2026 at 12:29 pm

    You mean the user input will disappear? If so this is probably because cellForRowAtIndexPath: reuses the cell and will execute the [self CreateTextField] again.

    So, unless you store the user input before the cell disappears, your cells will be redrawn empty and reinitialized empty.

    If you do store the user input, you could reinitialize the cell with the right user input.

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

Sidebar

Related Questions

I have several ReorderLists on a page. Each list has items added to it
I have a simple TableView containing several cells. Normally, I switch to selected cell
I have several Core Data model version that I have added to my .xcdatamodeld
I use several jquery ui dialogs in my application to collect input from users
I've added several localizations to my osx applications. English Simplified Chinese Traditional Chinese Italian
I'm writing a console application in Visual Basic 2008 Express. I added several text
I have several forms added to the pages of the tab control via tabcontrol.tabpages.controls.add
There are several questions discussing ways in which progress indication can be added to
I have a form in which several buttons are added at runtime via a
i just added a launch image to an application i wrote. According to several

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.