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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T03:32:42+00:00 2026-05-27T03:32:42+00:00

In my application i am having 37 textfield on tableview to scroll.If suppose i

  • 0

In my application i am having 37 textfield on tableview to scroll.If suppose i enter some value in first textfield and scroll the table ,the value enter in first textfiled disappaears as well as the layout.can any one help me out;

following is my code:

#import "Edit.h"


@implementation Edit
@synthesize tableContents,textField,scrollView;
@synthesize txtUserName,txtFirstName,txtLastName,txtNickName,txtDisplayName,txtEmail,txtWebSite,txtAboutMe,txtNewPassword,txtPasswordAgain;
@synthesize txtPayPalEmail ,txtActiveMemPk ,txtMemPkExpireDate;
@synthesize txtBusinessName ,txtAbnAcn ,txtContactName ,txtPhone ,txtFax ,txtMobile ,txtBusinessEmail ,txtFacebookLink ,txtLinkedinLink ,txtMySpaceLink;
@synthesize txtBlogLink ,txtInstanMessage ,txtWebsite ,txtStreet ,txtCitySuburb ,txtZipCode ,txtState ,txtTradingHour;
@synthesize  txtActiveOfService ,txtTradeOnWeekend ,txtProduct , txtService ,txtPickUpAndDelivery;



- (id)initWithStyle:(UITableViewStyle)style
{
    self = [super initWithStyle:style];
    if (self) {
        // Custom initialization
    }
    return self;
}

- (void)dealloc
{
    [super dealloc];
}



#pragma mark - View lifecycle

- (void)viewDidLoad
{

    self.navigationController.navigationBar.tintColor = [UIColor blackColor];
    //self.view.backgroundColor = [UIColor colorWithPatternImage:[UIImage imageNamed:@"main-bg.png"]];

    UIBarButtonItem *updatebtn = [[UIBarButtonItem alloc] 
                                  initWithTitle:@"Update"                                            
                                  style:UIBarButtonItemStyleBordered 
                                  target:self 
                                  action:@selector(update)];
    self.navigationItem.rightBarButtonItem = updatebtn;

    [updatebtn release];

    [super viewDidLoad];
    NSArray *text = [[NSArray alloc]initWithObjects:@"",@"",@"",@"",@"",@"",@"",@"",@"",@"",@"",@"",@"",@"",@"",@"",@"",@"",@"",@"",@"",@"",@"",@"",@"",@"",@"",@"",@"",@"",@"",@"",@"",@"",@"",@"",@"",nil];
    NSDictionary *textData = [[NSDictionary alloc]initWithObjectsAndKeys:text,@"",nil];
    self.tableContents = textData;
    self.textField = [[self.tableContents allKeys] sortedArrayUsingSelector:@selector(compare:)];



}




-(NSInteger) numberOfSectionInTableView:(UITableView *)tableView
{
    return[self.textField count];
}




-(NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
{

    NSArray *lsData =[self.tableContents objectForKey:[self.textField objectAtIndex:section]];
    return [lsData count];

}


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

    static NSString *TextCellIdentifier =@"Cell";

    UITableViewCell *cell =[tableView dequeueReusableCellWithIdentifier:TextCellIdentifier];


    if (cell==nil)
    {
        cell=[[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:TextCellIdentifier ] autorelease];
        cell.accessoryType= UITableViewCellAccessoryNone;
        cell.selectionStyle=UITableViewCellSelectionStyleNone;
        cell.font = [UIFont fontWithName:@"Helvetica" size:14];
    }
    if ([indexPath row]==0) 
    {
        txtUserName=[[UITextField alloc]initWithFrame:CGRectMake(0, 0, 150, 25)];
        txtUserName.placeholder=@"username";
        txtUserName.autocorrectionType=UITextAutocorrectionTypeNo;
        [txtUserName setClearButtonMode:UITextFieldViewModeWhileEditing];
        [txtUserName setEnabled:YES];
        cell.accessoryView=txtUserName;
        cell.textLabel.text=@"User Name:";


    }
    if ([indexPath row]==1) 
    {
        txtFirstName=[[UITextField alloc]initWithFrame:CGRectMake(0, 0, 150, 25)];
        txtFirstName.placeholder=@"first name";
        cell.accessoryView=txtFirstName;
        cell.textLabel.text=@"First Name:";
    }
    if ([indexPath row]==2) 
    {
        txtLastName=[[UITextField alloc]initWithFrame:CGRectMake(0, 0, 150, 25)];
        txtLastName.placeholder=@"last name";
        cell.accessoryView=txtLastName;
        cell.textLabel.text=@"Last Name";
    }
    if ([indexPath row]==3) 
    {
        txtNickName=[[UITextField alloc]initWithFrame:CGRectMake(0, 0, 150, 25)];
        txtNickName.placeholder=@"nick name";
        cell.accessoryView=txtNickName;
        cell.textLabel.text=@"Nick Name";
    }
    if ([indexPath row]==4) 
    {
        txtDisplayName=[[UITextField alloc]initWithFrame:CGRectMake(0, 0, 150, 25)];
        txtDisplayName.placeholder=@"display name";
        cell.accessoryView=txtDisplayName;
        cell.textLabel.text=@"Diaplay Name:";
    }
    if ([indexPath row]==5) 
    {
        txtEmail=[[UITextField alloc]initWithFrame:CGRectMake(0, 0, 150, 25)];
        txtEmail.placeholder=@"email";
        cell.accessoryView=txtEmail;
        cell.textLabel.text=@"Email ID:";
        //txtEmail.text=[NSString stringWithFormat:@"%@",user_email];
        //cell.textAlignment=UITextAlignmentRight;  
    }
    if ([indexPath row]==6) 
    {
        txtWebSite=[[UITextField alloc]initWithFrame:CGRectMake(0, 0, 150, 25)];
        txtWebSite.placeholder=@"website";
        cell.accessoryView=txtWebSite;
        cell.textLabel.text=@"Website:";
    }
    if ([indexPath row]==7) 
    {
        txtAboutMe=[[UITextField alloc]initWithFrame:CGRectMake(0, 0, 150, 25)];
        cell.accessoryView=txtAboutMe;
        cell.textLabel.text=@"About Me:";
        //cell.font =[UIFont fontWithName:@"impact" size:14];
        //txtAboutMe.font=[UIFont boldSystemFontOfSize:20];
        //txtAboutMe.backgroundColor=[UIColor clearColor];
        //cell.textAlignment=UITextAlignmentRight;
    }
    if ([indexPath row]==8) 
    {
        txtNewPassword=[[UITextField alloc]initWithFrame:CGRectMake(0, 0, 150, 25)];
        txtNewPassword.placeholder=@"new password";
        cell.accessoryView=txtNewPassword;
        cell.textLabel.text=@"New Password:";
    }
    if ([indexPath row]==9) 
    {
        txtPasswordAgain=[[UITextField alloc]initWithFrame:CGRectMake(0, 0, 150, 25)];
        txtPasswordAgain.placeholder=@"confirm password";
        cell.accessoryView=txtPasswordAgain;
        cell.textLabel.text=@"Confirm Password:";
    }
    if ([indexPath row]==10) 
    {
        UILabel *lblExtendedProfileInfo=[[UILabel alloc] initWithFrame:CGRectMake(0,0,270,25)];
        lblExtendedProfileInfo.text=@"Extended Profile Information:";
        lblExtendedProfileInfo.font=[UIFont boldSystemFontOfSize:14];
        cell.accessoryView=lblExtendedProfileInfo;
        lblExtendedProfileInfo.textAlignment=UITextAlignmentLeft;
    }
    if ([indexPath row]==11) 
    {
        txtPayPalEmail=[[UITextField alloc]initWithFrame:CGRectMake(0, 0, 150, 25)];
        txtPayPalEmail.placeholder=@"pay pal email";
        cell.accessoryView=txtPayPalEmail;
        cell.textLabel.text=@"Pay Pal Email";
    }
    if ([indexPath row]==12) 
    {
        txtActiveMemPk=[[UITextField alloc]initWithFrame:CGRectMake(0, 0, 150, 25)];
        txtActiveMemPk.placeholder=@"Active Member Pack";
        cell.accessoryView=txtActiveMemPk;
        cell.textLabel.text=@"Active Memberhip:";
    }
    if ([indexPath row]==13) 
    {
        txtMemPkExpireDate=[[UITextField alloc]initWithFrame:CGRectMake(0, 0, 150, 25)];
        txtMemPkExpireDate.placeholder=@"member pack expire date";
        cell.accessoryView=txtMemPkExpireDate;
        cell.textLabel.text=@"Membership Pack:";
    }
    if ([indexPath row]==14) 
    {
        UILabel *lblExtendedProfileInfo=[[UILabel alloc] initWithFrame:CGRectMake(0,0,270,25)];
        lblExtendedProfileInfo.text=@"Business Information:";
        lblExtendedProfileInfo.font=[UIFont boldSystemFontOfSize:14];
        cell.accessoryView=lblExtendedProfileInfo;
        //lblExtendedProfileInfo.textAlignment=UITextAlignmentLeft;

    }
    if ([indexPath row]==15) 
    {
        txtBusinessName=[[UITextField alloc]initWithFrame:CGRectMake(0, 0, 150, 25)];
        txtBusinessName.placeholder=@"Business name";
        cell.accessoryView=txtBusinessName;
        cell.textLabel.text=@"Business Name:";
    }
    if ([indexPath row]==16) 
    {
        txtAbnAcn=[[UITextField alloc] initWithFrame:CGRectMake(0,0,150,25)];
        txtAbnAcn.placeholder=@" Abn /Acn";
        cell.accessoryView=txtAbnAcn;
        cell.textLabel.text=@"Abn/Acn:";
    }
    else if ([indexPath row]==17)
    {
        txtContactName=[[UITextField alloc] initWithFrame:CGRectMake(0,0,150,25)];
        txtContactName.placeholder=@"Contact Name";
        cell.accessoryView=txtContactName;
        cell.textLabel.text=@"Contact Name:";

    }


    else if ([indexPath row]==18)
    {
        txtPhone=[[UITextField alloc] initWithFrame:CGRectMake(0,0,150,25)];
        txtPhone.placeholder=@"Phone No";
        cell.accessoryView=txtPhone;
        cell.textLabel.text=@"Phone No:";

    }

    else if ([indexPath row]==19)
    {
        txtFax=[[UITextField alloc] initWithFrame:CGRectMake(0,0,150,25)];
        txtFax.placeholder=@"Fax ";
        cell.accessoryView=txtFax;
        cell.textLabel.text=@"Fax:";
    }

    else if ([indexPath row]==20)
    {
        txtMobile=[[UITextField alloc] initWithFrame:CGRectMake(0,0,150,25)];
        txtMobile.placeholder=@"Mobile No";
        cell.accessoryView=txtMobile;
        cell.textLabel.text=@"Mobile No:";

    }

    else if ([indexPath row]==21)
    {
        txtBusinessEmail=[[UITextField alloc] initWithFrame:CGRectMake(0,0,150,25)];
        txtBusinessEmail.placeholder=@" Business Email";
        cell.accessoryView=txtBusinessEmail;
        cell.textLabel.text=@"Business Email:";


    }

    else if ([indexPath row]==22)
    {
        txtFacebookLink=[[UITextField alloc] initWithFrame:CGRectMake(0,0,150,25)];
        txtFacebookLink.placeholder=@"Facebook Link";
        cell.accessoryView=txtFacebookLink;
        cell.textLabel.text=@"Facebook Link:";


    }

    else if ([indexPath row]==23)
    {
        txtLinkedinLink=[[UITextField alloc] initWithFrame:CGRectMake(0,0,150,25)];
        txtLinkedinLink.placeholder=@"Linked In Link";
        cell.accessoryView=txtLinkedinLink;
        cell.textLabel.text=@"Linked In Link:";

    }

    else if ([indexPath row]==24)
    {
        txtMySpaceLink=[[UITextField alloc] initWithFrame:CGRectMake(0,0,150,25)];
        txtMySpaceLink.placeholder=@"My Space Link";
        cell.accessoryView=txtMySpaceLink;
        cell.textLabel.text=@"My Space Link:";
    }

    else if ([indexPath row]==25)
    {
        txtBlogLink=[[UITextField alloc] initWithFrame:CGRectMake(0,0,150,25)];
        txtBlogLink.placeholder=@"Blog Link";
        cell.accessoryView=txtBlogLink;
        cell.textLabel.text=@"Blog Link:";

    }

    else if ([indexPath row]==26)
    {
        txtInstanMessage=[[UITextField alloc] initWithFrame:CGRectMake(0,0,150,25)];
        txtInstanMessage.placeholder=@"Instant Message";
        cell.accessoryView=txtInstanMessage;
        cell.textLabel.text=@"Instant Message:";

    }
    else if ([indexPath row]==27)
    {
        txtWebsite=[[UITextField alloc] initWithFrame:CGRectMake(0,0,150,25)];
        txtWebsite.placeholder=@"Web Site";
        cell.accessoryView=txtWebsite;
        cell.textLabel.text=@"Web Site:";

    }

    else if ([indexPath row]==28)
    {
        txtStreet=[[UITextField alloc] initWithFrame:CGRectMake(0,0,150,25)];
        txtStreet.placeholder=@"Street";
        cell.accessoryView=txtStreet;
        cell.textLabel.text=@"Street:";

    }

    else if ([indexPath row]==29)
    {
        txtCitySuburb=[[UITextField alloc] initWithFrame:CGRectMake(0,0,150,25)];
        txtCitySuburb.placeholder=@"City Suburb";
        cell.accessoryView=txtCitySuburb;
        cell.textLabel.text=@"City Suburb:";

    }

    else if ([indexPath row]==30)
    {
        txtZipCode=[[UITextField alloc] initWithFrame:CGRectMake(0,0,150,25)];
        txtZipCode.placeholder=@"Zip Code";
        cell.accessoryView=txtZipCode;
        cell.textLabel.text=@"Zip Code:";

    }
    else if ([indexPath row]==31)
    {

        cell.textLabel.text=@"State:";
        cell.textAlignment=UITextAlignmentRight;

        //arrayData = [[NSArray alloc] initWithArray:[NSArray arrayWithObjects:@"Vinod",@"Parth",@"Nilesh",nil]];
//      
//      stateDropDownBox = [[DropDownView alloc] initWithArrayData:arrayData cellHeight:30 heightTableView:100 paddingTop:-8 paddingLeft:-5 paddingRight:-10 refView:stateDDownBox animation:BLENDIN openAnimationDuration:2 closeAnimationDuration:2];
//      
//      stateDropDownBox.delegate = self;
//      [self.view addSubview:stateDropDownBox.view];
//      
//      stateDDownBox=[UIButton buttonWithType:UIButtonTypeCustom];
//      //ddState.frame=CGRectMake(0, 0,360,45);
//      stateDDownBox.frame=CGRectMake(0, 0,320,45);
//      UIImage *img=[UIImage imageNamed:@"drop-down-box.png"];
//      [stateDDownBox setBackgroundImage:img forState:UIControlStateNormal];
//      [stateDDownBox addTarget:self action:@selector(dropDownClick) forControlEvents:UIControlEventTouchUpInside];
//      [stateDDownBox setTitle:[arrayData objectAtIndex:0] forState:UIControlStateNormal];
//      cell.accessoryView=stateDDownBox;


    }

    else if ([indexPath row]==32)
    {
        txtTradingHour=[[UITextField alloc] initWithFrame:CGRectMake(0,0,150,25)];
        txtTradingHour.placeholder=@"Trading Hour";
        cell.accessoryView=txtTradingHour;
        cell.textLabel.text=@"Trading Hour:";
    }

    if ([indexPath row]==33)
    {
        txtActiveOfService=[[UITextField alloc] initWithFrame:CGRectMake(0,0,150,25)];
        txtActiveOfService.placeholder=@"Active Of Service";
        cell.accessoryView=txtActiveOfService;
        cell.textLabel.text=@"Active Of Service:";

    }

    else if ([indexPath row]==34)
    {
        txtTradeOnWeekend=[[UITextField alloc] initWithFrame:CGRectMake(0,0,150,25)];
        txtTradeOnWeekend.placeholder=@"Trade Of Weekend";
        cell.accessoryView=txtTradeOnWeekend;
        cell.textLabel.text=@"Do you trade on Weekends?:";
        //      button=[UIButton buttonWithType:UIButtonTypeCustom];
        //      button.frame=CGRectMake(0, 0,360,45);
        //      UIImage *img=[UIImage imageNamed:@"button_back.png"];
        //      [button setBackgroundImage:img forState:UIControlStateNormal];
        //      [button addTarget:self action:@selector(actionButtonClick) forControlEvents:UIControlEventTouchUpInside];
        //      [button setTitle:[arrayData objectAtIndex:0] forState:UIControlStateNormal];
        //      cell.accessoryView=button;

    }

    else if ([indexPath row]==35)
    {
        txtProduct=[[UITextField alloc] initWithFrame:CGRectMake(0,0,150,25)];
        txtProduct.placeholder=@"Product";
        cell.accessoryView=txtProduct;
        cell.textLabel.text=@"Product:";
        //txtProduct.text=[NSString stringWithFormat:@"%@",business_product];
        //cell.textAlignment=UITextAlignmentRight;
    }

    else if ([indexPath row]==36)
    {
        txtPickUpAndDelivery=[[UITextField alloc] initWithFrame:CGRectMake(0,0,150,25)];
        txtPickUpAndDelivery.placeholder=@"Pickup and Delivery";
        cell.accessoryView=txtPickUpAndDelivery;
        cell.textLabel.text=@"Pickup and Delivery:";
        //txtPickUpAndDelivery.text=[NSString stringWithFormat:@"%@",business_delivery];
        //cell.textAlignment=UITextAlignmentRight;


    }




        return cell;

}

-(void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{

    [tableView deselectRowAtIndexPath:indexPath animated:YES];


}

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

@end
  • 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-27T03:32:43+00:00Added an answer on May 27, 2026 at 3:32 am

    Managing textfields in Tableview is a bit tediuos, If the number of textfields are fixed you can try using view controller with 37 (If the number is fixed) textfield in a scroll view. Manging the scrolling can be done using this

    If you still want to stick to your appraoch. then keeping the values of textfields in a mutable dictionary and use the data when you scroll through the tableview.

    Edit: The screen shot attached shows a simple view holding scrollview with multiple textfields. You can create IBOutlets to link these textfield in your code and set/get the values in these. If the number of textfields are too many you can use the above mentioned approach to scroll down to the last textfield and manage keyboard covering up the view.

    enter image description here

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

Sidebar

Related Questions

I've got a multi-user application having some critical data of the users. I am
i'm having this problem: Suppose you've a blog application and you want to display
I am trying to automate a web application having javascript. I am using WWW::Scripter
I am working on JRuby on Rails Application having JRuby-1.6.7 and Rails 3.2.2 I
I have created an tab bar application having 3 tab. When I am launching
I am currently writing an application having a client server architecture. The client is
A small - little question. I have seen many application having buttons like following.
My application is having memory problems, including copying lots of strings about, using the
I have web application Project having RPC call. one RPC async is working fine.
I would like to limit an application to having only one instance running on

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.