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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T18:56:12+00:00 2026-05-23T18:56:12+00:00

I am just curious. In IB, we can put a tableviewcontroller. However, as far

  • 0

I am just curious. In IB, we can put a tableviewcontroller. However, as far as I know, we always subclass that tableview controller right? That way we can implement delegate, etc.

However, it seems that for some “default” behavior, IPhone intended tableviewcontroller to be used as is. Otherwise, why would IB let us put tableViewController like that?

Are there any sample code where people use tableViewController without subclassing?

Where does they implement things like what cells to draw, etc. then?


I guess the right answer of the question is that it’s simply ridiculous to use a UITableViewController without sub classing. No body is doing it. Please correct me if I am wrong. I am just curious.

  • 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-23T18:56:13+00:00Added an answer on May 23, 2026 at 6:56 pm

    Whether you use a subclass of UITableViewController or UIViewController you need to set the data your table is going to display, otherwise, what’s the point of a blank table? To achieve that you have to subclass and implement some methods. It’s also a good idea to keep the delegate and the datasource in the same controller, unless the complexity really asks for different classes.

    That being said, I always create my own table controllers as a subclass of UIViewController and implement the table controllers methods myself, because it gives you more flexibility. Matt Gallagher has several posts on how and why. See UITableView construction, drawing and management (revisited).

    If you want to give it a try, create a subclass of UIViewController with a XIB and add the following sample code:

    // interface
    #import <UIKit/UIKit.h>
    @interface SettingsVC : UIViewController <UITableViewDelegate, UITableViewDataSource> 
    @property (nonatomic, retain) IBOutlet UITableView *tableView;
    @property (nonatomic, retain) NSMutableArray *array;
    @end
    
    // implementation
    @synthesize tableView = _tableView;
    @synthesize array = _array;
    # pragma mark - UITableViewDataSource
    - (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView {
        return 1;
    }
    - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
        return [self.array count];
    }
    - (UITableViewCell *)tableView:(UITableView *)aTableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
        int row = [indexPath row];
        static NSString *CellIdentifier = @"Cell";
        UITableViewCell *cell = [aTableView dequeueReusableCellWithIdentifier:CellIdentifier];
        if (cell == nil) {
            cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier] autorelease];
        }
        cell.textLabel.text = [self.array objectAtIndex:row];
        return cell;
    }
    

    Then add a UITableView object to the XIB, link the tableView of the controller to the UITableView object, and link the delegate and datasource of the UITableView to the controller.

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

Sidebar

Related Questions

Just a curious question but is there any programs that can help/aid you when
I can't find anything that gives a definitive answer. I was just curious if
Just curious. Right now I'm using Visual C# Express 2008 for Desktop Apps, and
I was just curious about how can i attach some different task to the
I'm just curious if I can have any other data type to give the
Consider the following code (you can just put this in the developer console in
Just curious, can flash take each frame and export it out as a image
I am just curious what exactly is simple evenhandler good for. I can have:
Just curious, Can you fake an uptime , for instance increase it to 10
Just curious, why can't I have/see my bg img on this span, unless I

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.