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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T04:23:17+00:00 2026-06-04T04:23:17+00:00

When I am entering text in textfield 1 that text is also displayed in

  • 0

When I am entering text in textfield 1 that text is also displayed in textfield 9.

here is some code what i did to create textfield in tableview cell.

i added textfield in tableview cell .like below in cellforRowatintexpath method

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

static NSString *CellIdentifier = @"myCell";
//UILabel* nameLabel = nil;
cell = (UITableViewCell *)[tableView dequeueReusableCellWithIdentifier:CellIdentifier];
if(cell == nil)
{

    cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier] autorelease];
     cell.selectionStyle = UITableViewCellSelectionStyleNone;
}
else
{
    UILabel *titleLbl = (UILabel *)[cell viewWithTag:1];
    [titleLbl removeFromSuperview];
}
nameLabel = [[UILabel alloc] initWithFrame:CGRectMake( 7.0, 10.0, 160.0, 44.0 )];
nameLabel.text = [labels objectAtIndex:indexPath.row];
nameLabel.font = [UIFont boldSystemFontOfSize:12]; 
nameLabel.lineBreakMode = UILineBreakModeWordWrap;
nameLabel.tag =1;
nameLabel.numberOfLines =0;
[nameLabel sizeToFit];
CGSize expectedlabelsize = [nameLabel.text sizeWithFont:nameLabel.font constrainedToSize:nameLabel.frame.size lineBreakMode:UILineBreakModeWordWrap];
CGRect newFrame =nameLabel.frame;
newFrame.size.height =expectedlabelsize.height;
[cell.contentView addSubview: nameLabel];
[nameLabel release]; 


//adding textfield to tableview cell. 
tv = [[UITextField alloc] initWithFrame:CGRectMake(nameLabel.frame.origin.x+nameLabel.frame.size.width+2, 10.0, cell.contentView.bounds.size.width, 30)];
tv.tag = indexPath.row + 2;
//tv.text =[labels objectAtIndex:indexPath.row];
tv.font = [UIFont boldSystemFontOfSize:12];


//this method will take text from textfield of tableview cell using their individual tag
[tv addTarget:self action:@selector(getTextFieldValue:) forControlEvents:UIControlEventEditingDidEnd];

[cell.contentView addSubview:tv];

[tv setDelegate:self];


[tv release];   


return cell;}

and here is the method getTextFieldValue method

- (void) getTextFieldValue:(UITextField *)textField{ 

if (textField.tag == 2) { 

    //NSString *value1 = [NSString stringWithFormat:@"%@",textField.text];
    //NSLog(@"value1 is %@",value1);.

    NSLog(@"2--->%@",textField.text); 
}else if(textField.tag == 3){ 
    NSLog(@"3--->%@",textField.text); 
}else if(textField.tag == 4){ 
    NSLog(@"4--->%@",textField.text); 
    } 
else if(textField.tag == 5){ 
    NSLog(@"5--->%@",textField.text); 
} 
else if(textField.tag == 6){ 
    NSLog(@"6--->%@",textField.text); 
} 
else if(textField.tag == 7){ 
    NSLog(@"7--->%@",textField.text); 
} 
else if(textField.tag == 8){ 
    NSLog(@"8--->%@",textField.text); 
} 
else if(textField.tag == 9){ 
    NSLog(@"9--->%@",textField.text); 
} 
else if(textField.tag == 10){ 
    NSLog(@"10--->%@",textField.text); 
} 
else if(textField.tag == 11){ 
        NSLog(@"11--->%@",textField.text); 
} 
else if(textField.tag == 12){ 
        NSLog(@"12--->%@",textField.text); 
} }
  • 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-04T04:23:18+00:00Added an answer on June 4, 2026 at 4:23 am

    That is the retain problem is there.

    You can take different cellIdentifier for each row. Only change one statement you get your solution.

    Solve this problem with above method. i was facing same problem & i solve with this method.
    I hope this will help you.

    NSString *CellIdentifier = [NSString stringWithFormat:@"cellidentifier-%d",indexPath.row];
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want to use Ckeditor for Entering text and I want to save that
I'm using the code snippet below to create a JFormattedTextField. When entering values via
i m using text field to get some integer value. After entering value and
Okay, so basically I want to be able to retrieve keyboard text. Like entering
I am entering data in the text field of my form that contains 2
I have a jquery game that you can view here link text The game
I have a jquery game that you can view here link text The game
My layout looks like this: <LinearLayout> <RelativeLayout> Some Image and Text as Title </RelativeLayout>
I have a table view that has embedded UITextFields for entering some data. It
I need to create several screens-forms that would be used for entering data and

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.