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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T09:48:51+00:00 2026-06-10T09:48:51+00:00

I placed three textfields in one row and 1 textfield in another row. I

  • 0

enter image description hereCheck this image enter image description hereI placed three textfields in one row and 1 textfield in another row. I took all the textfields in one array and wrote the following in cellForRowAtIndexPath

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{
    static NSString *cellIdentifier = @"MyIdentifier";
    UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:cellIdentifier];
    if(cell == nil)
    {
        cell = [[UITableViewCell alloc]initWithStyle:UITableViewCellStyleDefault reuseIdentifier:cellIdentifier ];
        if (indexPath.row == 0) {

            UITextField *tf = [[UITextField alloc]initWithFrame:CGRectMake(10, 10, 100, 30)];
            tf.delegate = self;
            tf.tag = 16;
            tf.borderStyle = UITextBorderStyleRoundedRect;
            [cell.contentView addSubview:tf];
            [tf release];

            UITextField *tf1 = [[UITextField alloc]initWithFrame:CGRectMake(150, 10, 100, 30)];
            tf1.delegate = self;
            tf1.tag = 17;
            tf1.borderStyle = UITextBorderStyleRoundedRect;
            [cell.contentView addSubview:tf1];
            [tf1 release];
        }
        else {
            UITextField *tf3 = [[UITextField alloc]initWithFrame:CGRectMake(10, 10, 100, 30)];
            tf3.delegate = self;
            tf3.tag = 18;
            tf3.borderStyle = UITextBorderStyleRoundedRect;
            [cell.contentView addSubview:tf3];
            [tf3 release];

        }

    }
    UITextField *tf = (UITextField *)[cell.contentView viewWithTag:16];
    tf.text =  [m_textFieldArray objectAtIndex:indexPath.row];

    UITextField *tf1 = (UITextField *)[cell.contentView viewWithTag:17];
    tf1.text =  [m_textFieldArray objectAtIndex:indexPath.row];
    UITextField *tf3 = (UITextField *)[cell.contentView viewWithTag:18];
    tf3.text =  [m_textFieldArray objectAtIndex:indexPath.row];
   // cell.textLabel.text = @"Hiiiii";
    return cell;
}

and in the textFieldDidEndEditing method wrote as follows.

[textFieldsDataArray replaceObjectAtIndex:currentIndexPath.row withObject:textField.text];

My Problem is once i enter text in one textfield and scroll up and down then that same text is taking to remaining two textfields in that same row.

and if i enter text in three textfields and then scroll , that is taking text from the last textfield for all.

  • 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-10T09:48:52+00:00Added an answer on June 10, 2026 at 9:48 am

    Sounds like you are having an issue with cell reuse.

    To increase performance, UITableView will reuse a cell off screen instead of creating a new cell. When a cell gets reused, it does not clear it out. Its your job to reassign what information you want in it.

    you set the information something like this:

    - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
    {
        static NSString *CellIdentifier = @"Cell";
    
        UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier]
    
        // If the cell is nil, it is a new cell and you need to init it    
        if (cell == nil)
        {
            cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier];
        }
    
        // setting the cell's information
        cell.textLabel.text = [dataSource objectAtIndex:indexPath.row];
        cell.textLabel.textAlignment = UITextAlignmentLeft;
        cell.accessoryType = UITableViewCellAccessoryDisclosureIndicator;
        cell.selectionStyle = UITableViewCellSelectionStyleBlue;
    
        return cell;
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I need to place 3 buttons and one textfield in UIAlertview. I wrote code
I need to append the following code via innerHTML to a HTML textfield. <script
I did a simple view based application. I need to place three textfields in
Hi I prepared one swing frame in which I placed two text fields. Is
I placed a UIImageView in for the accessoryView in a UITableViewCell ala: UIImage* dragHandleImage
I have a textfield that needs validation and is placed next to the submit
I have three view on the same place. I need to show them like
Are there any best-practices that state custom code shouldn't be placed in a System
There is a task to display an image, which is placed to a Google
Is there a place when I can put default imports for all my modules?

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.