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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T00:17:35+00:00 2026-05-23T00:17:35+00:00

I have a UITableView tableHeaderView defined in a nib file. The tableHeaderView contains a

  • 0

I have a UITableView tableHeaderView defined in a nib file. The tableHeaderView contains a UITextView. The UITextView’s delegate is set to the UITableViewController and the UITableViewController supports the UITextViewDelegate protocol. The UITableViewController is setting various properties in the tableHeaderView including the UITextView’s text and that all works fine. But textFieldShouldReturn:(UITextField *)textField in the UITableViewController never gets called and I can’t get the keyboard to close after I’ve tapped the UITextView.

I’ve tried every suggestion I can find in the docs and various posts, but no luck. None of the examples I’ve found have this specific case of a UITextView inside a tableHeaderView.

Is there something special I need to do. Has anyone done this successfully?

I’ve tried setting the UITextView delegate in code, but no luck.

@class Decision;

@interface DecisionDetailViewController : UITableViewController <UINavigationControllerDelegate, UITextViewDelegate> {

    Decision *decision;

    UIView *tableHeaderView;    
    UITextView *nameTextField;
}

@property (nonatomic, retain) Decision *decision;
@property (nonatomic, retain) IBOutlet UIView *tableHeaderView;
@property (nonatomic, retain) IBOutlet UITextView *nameTextField;

@end


@implementation DecisionDetailViewController

@synthesize decision;
@synthesize tableHeaderView;
@synthesize nameTextField;

- (void)viewDidLoad {
    self.navigationItem.rightBarButtonItem = self.editButtonItem;

    if (tableHeaderView == nil) {
        [[NSBundle mainBundle] loadNibNamed:@"DecisionDetailHeader" owner:self options:nil];
        self.tableView.tableHeaderView = tableHeaderView;
    }
}

- (BOOL)textFieldShouldReturn:(UITextField *)textField {
     [nameTextField resignFirstResponder];
     return YES;
}
  • 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-23T00:17:36+00:00Added an answer on May 23, 2026 at 12:17 am

    textFieldShouldReturn is a method of UITextFieldDelegate and not UITextViewDelegate. Thats probably your problem.

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

Sidebar

Related Questions

I have a UITableView that I have set-up with 2 sections. The code below
I have UITableView with cells. Cell contains image, label and detail label. Then I've
I have a UITableViewController , in which I added a UISearchBar as the tableHeaderView
I have my UITableView set up (in the standard way) to allow deletion on
I have a UITableView whose data source and delegate are switched between a couple
In my UITableView, I have a tableHeaderView that should resize itself according to the
I have placed a UISearchBar in my UITableView.tableHeaderView. However it covers the searchBar by
I have a UITableView with some cells. When a cell is tapped, I set
I have UITableView which contains cells. what I would like to do once user
I have UITableView.when i click on it's 1 st row one another UITableView opens

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.