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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T22:56:56+00:00 2026-06-13T22:56:56+00:00

Very beginner obj-c question. I have plain UITableView with two sections, but I am

  • 0

Very beginner obj-c question.

I have plain UITableView with two sections, but I am interested only in first section now. This section have four custom cells (inherited from standard UITableViewCell), and they have a UITextField’s as a property.

I need to improve custom Input Accessory View with buttons “Next”, “Previous”(for switch between textFields in tableview) and “Done” (dismissimg of keyboard). http://uaimage.com/image/62f08045

In -textFieldShouldReturn i set tags for textFields from 0 to 3. My next plan is to add textFields into NSMutableArray in -viewDidLoad and then just set and resign first responder for the textFields. Approximate code listing for “Next” button:

- (void) inputAccessoryViewDidSelectNext:(FDInputAccessoryView *)view {
    for (UITextField *textField in [self textFieldsArray]) {

        if ([textField isFirstResponder]) {

            [textField resignFirstResponder];
     UITextField *field = [[self textFieldsArray] objectAtIndex:textField.tag + 1];
            [field becomeFirstResponder];
        }

    }
}

Questions:

  • Is this a right way or maybe there is a better approach to solve problem?
  • Do I need to tag textfields or use indexPath of cells in what they are built in? (or what is the best to track textFields?)
  • And the main question: what is the syntax to “get” textField from cell?

Sorry for the dumb questions, I am a very beginner.

Thanks,
Alex.

  • 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-13T22:56:57+00:00Added an answer on June 13, 2026 at 10:56 pm

    I think you have the right idea, but a few things come to mind:

    • Just to be safe, don’t start with tag number 0. Every view has a tag number defaulted to 0, so you may get something unexpected.
    • Don’t set the text view’s tags inside of the textFieldShouldReturn, set the tags in cellForRowAtIndexPath or viewDidLoad, wherever you init the textFields.
    • Add the textFields to the cell’s contentView, not the cell itself.
    • You don’t have to resign first responder from the first text field, you can just becomeFirstResponder on the new one.
    • Make sure you’re handling the last text view edge case: You could loop around to the first text field or simply dismiss the keyboard at the end.

    If you want to get the textField in the cell:

    UITableViewCell *cell = [self.tableView cellForRowAtIndexPath:
                             [NSIndexPath indexPathForRow:ROW_NUMBER inSection:1]];
    UITextField *textField = (UITextField *)[cell.contentView viewWithTag:TEXT_FIELD_TAG];
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Very beginner obj-c question. I have grouped TableView with two sections http://uaimage.com/image/c6c9ca23 . In
Ok so this is probably a very beginner question but... Right now I have
i know this question was asked before but i have this very weird beginner
This is a very beginner question. I have tried to search for advice but
this is a very beginner question but I don't know javascript, I only wants
Very beginner obj-c question. Is it a possibility to ask about who is first
probably a very beginner's question, but I'm really interested in how to make it
Probably a very basic beginner question. Imagine the following situation: I have an ASP.NET
I am very beginner in Ruby and probably the question is too easy but
I am only a very beginner user of git and have a C# Visual

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.