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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T16:27:59+00:00 2026-05-24T16:27:59+00:00

I created a UITableViewController in a UIViewController subclass and setup delegate methods but the

  • 0

I created a UITableViewController in a UIViewController subclass and setup delegate methods but the data source delegate methods are not being called (by observing the logs). Do I need to subclass teh UITableViewController? What did I miss?

In MyViewController.h

@interface MyViewController : UIViewController <UITableViewDelegate, UITableViewDataSource> {
UITableViewController *myTableViewController;
}
@property (nonatomic, assign) UITableViewController *myTableViewController;

In MyViewController.m

- (void)viewDidLoad
{
    myTableViewController = [[UITableViewController alloc]initWithStyle:UITableViewStylePlain];
    myTableViewController.tableView.delegate = self;

}

- (NSInteger)tableView:(UITableView *)tableView
 numberOfRowsInSection:(NSInteger)section {
    NSLog(@"numberOfRowsInSection");
    return [self.assets count]; //assets is NSMutableArray
}

- (UITableViewCell *)tableView:(UITableView *)tableView
         cellForRowAtIndexPath:(NSIndexPath *)indexPath {

    NSLog(@"cellForRowAtIndexPath");
    static NSString *SimpleTableIdentifier = @"SimpleTableIdentifier";

    UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:
                             SimpleTableIdentifier];
    if (!cell) {
        cell = [[[UITableViewCell alloc]
                 initWithStyle:UITableViewCellStyleDefault
                 reuseIdentifier:SimpleTableIdentifier] autorelease];
    }
    NSUInteger row = [indexPath row];
    cell.textLabel.text = [assets objectAtIndex:row];  //assets is NSMutableArray
    cell.textLabel.font = [UIFont boldSystemFontOfSize:50];
    return cell;
}

I called the table view from another class:

UIPopoverController *popoverController = [[UIPopoverController alloc] initWithContentViewController:myTableViewController];
  • 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-24T16:28:00+00:00Added an answer on May 24, 2026 at 4:28 pm

    A UITableViewController is itself a view controller. So you wouldn’t normally create one within a view controller’s viewDidLoad. You’d normally either create a UITableView or subclass UITableViewController and let it worry about creating and setting up the relevant view.

    Even given that you’re creating a view controller, then hijacking its view to connect to you as a delegate, you’re failing to display that view. Since the view is never displayed, it never has any need to talk to its delegate. You probably intended to add the relevant view to your own within viewDidLoad.

    Finally, the two methods you’ve implemented are part of UITableViewDataSource, not UITableViewDelegate. The data source provides table contents, the delegate gets informed about taps and other related events. So you probably want to set yourself up as the data source, not the delegate.

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

Sidebar

Related Questions

As the title says none of my tableview controller methods are being called. The
I created the setup project for the application and I can see that the
I created a new SplitView iPad project in Xcode and setup the code to
My main controller is a subclass of UITableViewController with a UIToolBar at the bottom
I wish create my personal UITableViewController and use it into my UIViewController using interface
When you have an UIViewController and UITableViewController classes and you wanted to let these
I have created an iPhone UI programmatically but I just can't figure out how
please patient with my poor english. I'd bad concept of UIView, UIViewController, UITableView, UITableViewController
I have an NSFetchedResultsController inside a subclass of UITableViewController inside a UINavigationController . When
yes but i have a problem i have created a controller that inherits from

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.