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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T04:02:18+00:00 2026-06-07T04:02:18+00:00

I have a textView for which the submit button gets overlapped by the keyboard,

  • 0

I have a textView for which the submit button gets overlapped by the keyboard, so I am trying to add a listener for when a user taps anywhere else on the screen to get rid of the keyboard.

I am trying to add code like this to my controller:

-(void)touchesBegan:(NSSet *) touches withEvent:(UIEvent *)event
{
    [textView resignFirstResponder];
}

but this gives a syntax error that the textView is not declared. But that is confusing because I added the textView to the screen already.

Here is the code:

#import "FeedbackController.h"

@interface FeedbackController ()

@end

@implementation FeedbackController

- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
{
    self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
    if (self) {
        // Custom initialization
    }
    return self;
}

- (void)viewDidLoad
{
    [super viewDidLoad];
    // Do any additional setup after loading the view.
}



- (void)viewDidUnload
{
    [super viewDidUnload];
    // Release any retained subviews of the main view.
}

- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
{
    return (interfaceOrientation == UIInterfaceOrientationPortrait);
}

-(void)touchesBegan:(NSSet *) touches withEvent:(UIEvent *)event
{
    [textView resignFirstResponder];
}

- (IBAction)submitFeedback:(id)sender {
    NSLog(@"This is a test hello");
}
@end

And here is how the screen looks like:
enter image description here

Any idea how I can try to reference the textView correctly? and how I can make the keyboard disappear when the other parts of the screen are touched?

Thanks!

  • 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-07T04:02:18+00:00Added an answer on June 7, 2026 at 4:02 am

    In your .h file you will need to create an IBOutlet to the textView variable, here is how you create the outlet access view inside a storyboard

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

Sidebar

Related Questions

I have a form which renders, but when I click the submit button, I
I have a layout which contains button and textView with visibility=gone. This layout is
I have a TextView which i set the text using setText(). In properties, I
I have a Custom ListView which has an ImageView and a TextView. and i
I have a custom ListView in which there are 2 buttons and a textview
I have a view in which there is a text box where user enters
In my app I have a textView which contains real-time messages from my app,
I have to set the style for a TextView which is created programmatically. How
I have a TextView which I've assigned both an onTouchListener and an onClickListener: myTextView.setOnTouchListener(new
Guys i have a textview which i need it to be blinking please help

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.