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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T16:57:15+00:00 2026-06-02T16:57:15+00:00

How can I use a uitableview inside of a uiviewcontroller ? Below is an

  • 0

How can I use a uitableview inside of a uiviewcontroller? Below is an example of what I’m trying to do (except this is just the UITableview in my Storyboard):

UITableView inside a UIViewController

I’ve figured out that I need to add the delegate and data source to my header:

//MyViewController.h
@interface MyViewController : UIViewController <UITableViewDelegate, UITableViewDataSource>

In my Implementation file, I’ve added the required methods:

//MyViewController.m

- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView {
    // Return the number of sections.
    return 1;
}

- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
    return;
}

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
    NSLog(@"cellForRowAtIndexPath");

    UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"FileCell"];

    NSLog(@"cellForRowAtIndexPath");
    NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
    NSString *documentsDirectory = [paths objectAtIndex:0];
    NSArray *fileListAct = [[NSFileManager defaultManager] contentsOfDirectoryAtPath:documentsDirectory error:nil];

    cell.textLabel.text = [NSString stringWithFormat:@"%@",[fileListAct objectAtIndex:indexPath.row]];

    return cell;
}

The delegate, datasource, and UITableView are all hooked up in my Storyboard:

UITableView Delegate and DataSource in Interface Builder Connections Outlet

I can’t get the TableView to load the content that I tell it to. It always comes up blank. Why won’t the TableView fill with the content I tell it to in the cellForRowAtIndexPath method? What am I missing here?

  • 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-02T16:57:16+00:00Added an answer on June 2, 2026 at 4:57 pm

    You do have to link the dataSource and delegate outlets from the tableview in storyboard to the view controller. This is not optional. This is why your table is blank, it is never calling your view controller’s table view methods. (You can prove this by setting breakpoints on them and seeing that they never get triggered.) What sort of build errors are you getting?

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

Sidebar

Related Questions

Plz guide that how can i use 2 UItableView(or more) in a UIViewController &
I'm trying to use a UITextField inside a UITableViewCell as you can see in
How can I tell my UITableViewController to use my custom UITableView subclass for it's
I can use stat() to figure out what permissions the owner, group, or others
I can use ipcs(1) to list out the active shared memory objects on a
My application with a UITableView inside the contentview, and the tableview's contentsize is out
I know I can use codes to add UITableView one by one. [self.view addSubview:tableview1];//
I've been trying to access some instance methods of UITableView inside my UITableView class
Like many other developers out there, I've created iPhone projects that use a UITabBarController
I can use FireFox and FireBug, in a pane, I can open a .css

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.