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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T10:11:28+00:00 2026-06-04T10:11:28+00:00

I used to use XCode the develop my apps and using that; I could

  • 0

I used to use XCode the develop my apps and using that; I could create a link up in IB/Storyboard that synthesized this methods:

- (void)addTarget:(id)target action:(SEL)action forControlEvents: (UIControlEvents)controlEvents

for when

However, no I’m doing it all programmatically (in rubymotion, though not necessarily relevant) and looking into the documentation for UITextField I found some delegate methods, which I implemented as follows:

def textFieldShouldReturn(text_field)
  text_field.resignFirstResponder
end

def textFieldShouldEndEditing(text_field)
  # this is for validations; don't set a first responder here
  true
end

def textFieldDidEndEditing(text_field)
  text_field == @email_field ? @password_field.becomeFirstResponder : delegate.validate_login_info
end

But using this, I found that I could not tab through the input fields (of which I have two; email and password) as I could before with the addTarget approach.

What is the difference between these two approaches? Does the former implement the latter behind the scenes? I don’t understand why one will allow me to tab through and the other won’t. Did I just implement the delegate methods differently than the target/action approach does behind the scenes?

Feedback appreciated,
pachun

  • 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-04T10:11:29+00:00Added an answer on June 4, 2026 at 10:11 am

    This has nothing to do with target/action. I am assuming you mean in Interface Builder you would drag from the UITextField to the File's Owner and select delegate from the HUD.

    Doing the above would have the effect of assigning the textField’s delegate which you would need to do in code like this

    @email_field.delegate    = self
    @password_field.delegate = self
    

    the above is assuming that the class that creates the UITextField‘s will act as their delegate.

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

Sidebar

Related Questions

I develop for iOS and use XCode 3.2.5, GCC 4.2. UPD This code works:
I'm looking to use the UIPageViewController with Xcode's storyboard. The only example I could
I used to use procedural-style PHP. Later, I used to create some classes. Later,
I used to use this script for jquery email obfuscation: $(.replaceAt).replaceWith(@); $(.obfuscate).each(function () {
I've started to use XCode several months ago, after using IntelliJ for several years,
What is the difference between @property(nonatomic, retain) that we used in Xcode 3.2 and
I know how to use the Xcode debugger, and I've used po to display
I used to use the XCode to do development, which provide me to press
I would like to use Apple's Xcode IDE to develop applications on the OS
I am starting to develop apps for iPhone. There is 1 specific app that

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.