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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 19, 20262026-06-19T01:42:48+00:00 2026-06-19T01:42:48+00:00

I have setup a UITableView controller within my view controller as follows: fieldView =

  • 0

I have setup a UITableView controller within my view controller as follows:

fieldView = [[UITableView alloc] initWithFrame:CGRectMake(0, logoView.bounds.size.height, 320, (screen.size.height - logoView.bounds.size.height)) style:UITableViewStylePlain];
[fieldView setBackgroundColor:[UIColor greenColor]];
fieldView.autoresizingMask = UIViewAutoresizingFlexibleWidth|UIViewAutoresizingFlexibleTopMargin;

The view controller is setup to be a TableViewDelegate as follows:

 UIViewController <UITableViewDelegate, UITableViewDataSource...

Question: What do I need to do to the table view delegate methods for them to control this added sub view?

#pragma mark - 
#pragma Table View Delegate Methods
- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView {
    NSLog(@"Here");
    return 1;
}
- (NSString *)tableView:(UITableView *)fieldView titleForHeaderInSection:(NSInteger)section {
    NSString *sectionName;
    NSLog(@"Here2");

The above methods are in the view controller but not called?

  • 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-19T01:42:50+00:00Added an answer on June 19, 2026 at 1:42 am

    You need:

    // Add these right after creating the UITableView
    fieldView.delegate = self;
    fieldView.dataSource = self;
    
    // don't forget to add the tableview
    [self.view addSubview:fieldView];
    

    You also need all of the basic UITableViewDelegate and UITableViewDataSource methods. It’s exactly the same as if you had implemented a UITableViewController. At a minimum you need:

    tableView:numberOfRowsInSection:
    tableView:cellForRowAtIndexPath:
    

    If you plan to support table editing there are additional methods you must implement and override.

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

Sidebar

Related Questions

I have a view controller set up as follows: UIViewController In IB I have
I have a UITableView in view controller. I want to set up the view,
I have a view controller that lists some data in an UITableView . To
I have a main UITableView Controller that is backed by a NSFetchedResultsController, this view
Following setup causes trouble: In my storyboard I have a standard table view controller,
I have a storyboard setup as a Tabbed Application with first view controller containing
Setup: I have a UICollectionView or UITableView that’s backed by a simple array data
I have a navigation controller with a table view. In most tutorials I've read
Well in my app I have a navigation controller with a table view, and
I have a table view inside a View Controller. I can populate all my

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.