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

  • Home
  • SEARCH
  • 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 8949973
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T13:20:38+00:00 2026-06-15T13:20:38+00:00

I have a custom view for my tableview’s header UIView *headerTableview_; @property (nonatomic, retain)

  • 0

I have a custom view for my tableview’s header

UIView *headerTableview_;    
@property (nonatomic, retain) IBOutlet UIView *headerTableview;

I have connected it to xib file.

Then in .m file,

@synthesize headerTableview = headerTableview_;

- (CGFloat)tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section{
  return headerTableview_.frame.size.height;
}

- (UIView *)tableView:(UITableView *)tableView viewForHeaderInSection:(NSInteger)section{
  return headerTableview_;
}

Then, I try to run it, in iOS 6 it’s displayed well, but in iOS 4.3, it’s not displayed at all.

What could be the problem? Anyone knows how to fix this weird problem?
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-15T13:20:40+00:00Added an answer on June 15, 2026 at 1:20 pm

    In your .h file

    @interface testViewController : UIViewController <UITableViewDataSource, UITableViewDelegate>
    {
    
    UITableView *tableView;
    }
    @property (retain, nonatomic) IBOutlet UIView *testView;
    @end
    

    In your .m file

    @implementation testViewController
    
    @synthesize testView;
    - (void)viewDidLoad
    {
    [super viewDidLoad];
    
    tableView = [[UITableView alloc]initWithFrame:self.view.frame style:UITableViewStylePlain];
    tableView.delegate = self;
    tableView.dataSource =self;
    [self.view addSubview:tableView];
    [self.view bringSubviewToFront:tableView];
    // Do any additional setup after loading the view, typically from a nib.
    }
    - (CGFloat)tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section{
    return testView.frame.size.height;
    }
    
    - (UIView *)tableView:(UITableView *)tableView viewForHeaderInSection:(NSInteger)section{
    return testView;
    }
    
    - (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView{
    return 2;
    }
    
    - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section{
    return 3;
    
    }
    - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{
    static NSString *CellIdentifier = @"Products";
    UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
    if (cell == nil) {
        cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleSubtitle reuseIdentifier:CellIdentifier];}
    //UIImage *currentTweet = [[xmlParser tweets] objectAtIndex:1];
    cell.textLabel.text= @"text label";
    cell.detailTextLabel.text=@"detailTextLabel";
    
    return cell;}
    - (void)didReceiveMemoryWarning
    {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
    }
    
    - (void)dealloc {
    [testView release];
    [super dealloc];
    }
    @end
    

    Attaching image of o/p from simulator iOS4.3.2

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

Sidebar

Related Questions

I have a custom tableview cell created programmatically that consists of: a background view
I have a custom view (inherited from UIView ) in my app. The custom
I have a custom UIView subclass that i'm trying to use as a header
I have very custom TableView like Add Contact View in iPhone's Contacts. I like
So I have a view controller which adopts UITableViewDelegate: @interface MyViewController:UIViewController<UITableViewDelegate> @property (weak, nonatomic)
I have custom cell in my tableview. when uitable view is in the editing
I have UITableView with Custom View on it. For the bottom of the tableview,
I have a table view with a custom cell ( UISwitch on every cell
I have a table view controller with custom cells. In those cells i added
I have a custom View that I would like to embed in an WebView.

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.