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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T01:44:28+00:00 2026-06-06T01:44:28+00:00

(I’m targetting iOS 2.0 for the time being.) I have a class which subclasses

  • 0

(I’m targetting iOS 2.0 for the time being.)

I have a class which subclasses UITextField and implements the UITextFieldDelegate protocol.

At first, I did not set the class as its own delegate, and when I clicked in the field, the keyboard popped up automatically. So far, so good.

I send the setReturnKeyType: message with UIReturnKeyDone, so it changes the bottom-right button to say Done.

The problem was, when I clicked Done or pressed [Return], nothing happened – the keyboard wouldn’t go away.

I tried adding self as an observer for the end editing notification, but it never got called when Done was clicked; from a Google search it seems that only gets fired when the field resigns as the first responder – which is the bit I can’t get to happen.

I then found answers on here that suggested adding self as the delegate and handling textFieldShouldReturn:. The problem is, as soon as I add self as the delegate, the keyboard no longer pops up when you click the field (and it doesn’t gain focus) – it seems it isn’t becoming first responder.

I tried handling textFieldShouldBeginEditing: and returning YES (docs say that should be the default if not overridden), and that got called, but made no difference. In my ignorance I tried [textField becomeFirstResponder] and was rewarded with a stack overflow (now I know that is called in response to trying to become first responder).

I’m now thoroughly stuck!

Can anyone help? I just want the keyboard to go away when the user clicks Done or presses [Return].

  • 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-06T01:44:30+00:00Added an answer on June 6, 2026 at 1:44 am

    My fault. Turns out you’re not supposed to set a text field’s delegate to itself – there are complications due to unhandled selectors being forwarded to its delegate. If it doesn’t respond to a selector the message goes to its delegate… which is itself, which we already know doesn’t respond. Hence, an infinite loop.

    Using a separate object as the delegate worked perfectly.

    Hopefully this will help someone else avoid the same problem.

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

Sidebar

Related Questions

I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
I have a text area in my form which accepts all possible characters from
I have a .ini file as follows: [playlist] numberofentries=2 File1=http://87.230.82.17:80 Title1=(#1 - 365/1400) Example
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I have just tried to save a simple *.rtf file with some websites and
I am trying to understand how to use SyndicationItem to display feed which is
I used javascript for loading a picture on my website depending on which small
I have a jquery bug and I've been looking for hours now, I can't
this is what i have right now Drawing an RSS feed into the php,
I have this code to decode numeric html entities to the UTF8 equivalent character.

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.