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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T21:10:57+00:00 2026-05-20T21:10:57+00:00

I have a view that I’m displaying modally to get login information from a

  • 0

I have a view that I’m displaying modally to get login information from a user. I have the following setup:

  • The view controller is a UITableViewController
  • The table has three cells: username and password fields (both of type UITextField within UITableViewCell) and one simple cell as the login button.
  • Values are read from UITextField in textFieldDidEndEditing:message
  • The text fields are identified by different tag values.

The problem

My problem is that when the focus is in a UITextField and user touches the login button, the respective UITextField‘s textFieldDidEndEditing:message is sent after the didSelectRowAtIndexPath:. Now the issue here is that I’m sending a message of new user credentials to my LoginViewControllerDelegate in the didSelectRowAtIndexPath: and at that time the text field’s value is not read yet.

Some Ideas

I have some ideas how to fix this, but I have complications with each of them.

First, I could close the login view and the delegate is notified during the closing, but I want to give the delegate (one who owns this login view) full control and I think it should be the delegate’s job to close the login view on successful login (the login view only reads the credentials, the delegate validates these).

Second, I could also read the username or password just before calling the delegate but then I’d have to look up the text fields. If the views are not visible, I think it is wrong to assume that the cells do exist. This is just a big if, but I wan’t to make it right. Would it be ok to retain the UITextFields? This way, however, I can’t use some custom cell that would itself provide the textfield.

Basically I want the following:

  1. Need for (valid) user credentials is detected, login view is popped up
  2. User inputs the username and password and invokes done.
  3. The delegate validates these credentials. If they do not work, a message is shown and try step 2 again.
  4. Credentials are ok, so close the login view and continue.
  • 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-20T21:10:58+00:00Added an answer on May 20, 2026 at 9:10 pm

    After all tricks I finally figured that simply resigning the first responder right before invoking the delegate fixed this. In the table view controller I simply had to add a call:

        [[self.view findFirstResonder] resignFirstResponder];
    

    The findFirstResonder is from a category and can be found here.

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

Sidebar

Related Questions

I have a view that takes data from my site and then makes it
I have a view that will be displaying downloaded images and text. I'd like
I have a view that pushes another view with navigation controller. In this second
I have a view that is an input form that people input their information
I have view that contains a table with the following structure: <table id=mappings> <thead>
I have a view that render itself from a Collection: render: function() { $(this.el).html(JST['templates/menu']({collection:
In my application I have View that observes Model changes. Controller is responsible for
I have a view that's used to display Comments. You can obviously comment from
I have application with following design: Table View that lists documents. And ViewController where
I have a view that has text fields ranging from the top of the

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.