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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T20:41:13+00:00 2026-06-08T20:41:13+00:00

Im a beginner so please bear with me… In my app using xcode and

  • 0

Im a beginner so please bear with me… In my app using xcode and objective c, I would like to be able to detect when any key is pressed on the keyboard. I have looked and found some code for detecting only certain keys but I would like to make a method detecting any key strokes ranging from esc to enter. Ideally I would run a series of if statements any time any key is pressed.

//if a keystroke is detected run through this if statement

if([firstName.text length] < 1){

[firstNameLabel setHidden:NO];
 } else {
 [firstNameLabel setHidden:YES]; 
 }
 if([secondName.text length] < 1){

 [secondNameLabel setHidden:NO]; 
 } else {
 [secondNameLabel setHidden:YES]; 
 }
 if([email.text length] < 1){

 [emailLabel setHidden:NO]; 
 } else {
 [emailLabel setHidden:YES]; 
 }
 if([password.text length] < 1){

 [passwordLabel setHidden:NO]; 
 } else {
 [passwordLabel setHidden:YES]; 
 }
 if([passwordSame.text length] < 1){

 [passwordSameLabel setHidden:NO]; 
 } else {
 [passwordSameLabel setHidden:YES]; 
 }
 if([schoolName.text length] < 1){

 [schoolNameLabel setHidden:NO]; 
 } else {
 [schoolNameLabel setHidden:YES]; 
 }
 if([gradeLevel.text length] < 1){

 [gradeLevelLabel setHidden:NO]; 
 } else {
 [gradeLevelLabel setHidden:YES]; 
 }

Anyone have an idea of how you would write this method?

  • 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-08T20:41:16+00:00Added an answer on June 8, 2026 at 8:41 pm

    You should use the textField:shouldChangeCharactersInRange:replacementString: delegate method. You can use your logic and detect the keystrokes there.

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

Sidebar

Related Questions

I am a beginner so please bear with me. I am making an app
This is a beginner question, but please bear with me. I'd like to pass
I'm an absolute beginner at flash so please bear with me. I'm using Adobe
I'm a beginner programmer so please bear with me. This app runs fine but
I am a beginner in Haskell so please bear with me. (Just started learning
I am a beginner in SQLite, so please bear with me if what i'm
I'm a Java-beginner, so please bear with this one. I have a class: class
Please understand: I am a total beginner at Actionscript and anything like Actionscript, and
I am an absolute beginner. So please bear with me if I miss the
I am a beginner programmer so please bear with me. I am trying to

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.