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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T15:49:11+00:00 2026-05-24T15:49:11+00:00

I have dynamic number of textfields in my tableview, I put each textfield into

  • 0

I have dynamic number of textfields in my tableview, I put each textfield into a customcell in IB and load the cells by nibName.

I want to validate and show alert as user enters data, also when editingisDone I want to get the input value from user and save it to the relavent object.

for instance these are some delegate methods I can use:

- (void)textFieldDidEndEditing:(UITextField *)textField{
   //save the data
}

- (IBAction)textFieldDoneEditing:(id)sender {
    //hide the keypad when done is pressed
    [sender resignFirstResponder];
}

- (BOOL)textField:(UITextField *)textField shouldChangeCharactersInRange{}

2 questions:

1-When getting user input and validating the input how will I know which textfield’s delegate is fired since there are dynamic numbers of cells and textfields, and how can I manage this?

2-For hiding the keyboard I did this but not sure this is correct;
-In IB I opened the customcell–>right click uitextfield and connect its didEndonExit to FirstResponder‘s textFieldDoneEditing method. This works but I can’t return if I didnt add any chars to textfield. so it forces to write something in order to press the button.

  • 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-24T15:49:12+00:00Added an answer on May 24, 2026 at 3:49 pm

    With regards to your first question …

    In the following code I’ll assume you have one UITextField in each cell. I’ll also assume you’ve created an UITableViewCell subclass called CustomCell which contains an UITextField.

    #pragma mark - UITableViewDataSource 
    
    - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
    {
       static NSString *CellIdentifier = @"CellIdentifier";
       CustomCell *cell = (CustomCell *)[tableView dequeueReusableCellWithIdentifier:CellIdentifier];
       if (!cell)
       {
          cell = [[[CustomCell alloc] initWithStyle:UITableViewCellStyleDefault identifier:CellIdentifier] autorelease];
          cell.textField.tag = indexPath.row;
          cell.textField.delegate = self;
       }
       return cell; 
    }
    
    #pragma mark - UITextFieldDelegate 
    
    - (void)textFieldDidEndEditing:(UITextField *)textField
    {
       NSLog(@"textField tag: %d", textField.tag); // this will show which textField did end editing ...
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a ViewPager with a dynamic number of pages in it. Each of
I have a UIButton in UIViewController, i want add to dynamic number of UITextViews
I have a a gridview with a dynamic number of columns and rows. In
I have a form with a stage that has a dynamic number of groups
I have an empty LinearLayout , and I need to add a dynamic number
In my winform application, I have an arraylist containing a dynamic number of string
I have a UITableView with several sections, and the number of sections is dynamic,
I have a TableLayoutPanel which holds a dynamic number of controls inside a SplitterPanel.
I'm building an application which will have dynamic allocated objects of type A each
So I have a dynamic number of jobs which all have only one build

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.