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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T21:19:16+00:00 2026-05-27T21:19:16+00:00

I have googled and searched here on stackoverflow, but haven’t been able to find

  • 0

I have googled and searched here on stackoverflow, but haven’t been able to find a solution.

What I expect to happen: UITableView to display and show cells containing “hi”

What happens: UITableView doesn’t even display

viewViewController.h

#import <UIKit/UIKit.h>

@interface viewViewController : UIViewController

@property (strong, nonatomic) IBOutlet UITableView *tableView;
//note: the above property is connected to my UITableViewController

@end

viewViewController.m

#import "viewViewController.h"

@interface viewViewController ()

@end

@implementation viewViewController
@synthesize tableView = _tableView;

- (UITableView *)tableView
{
    if (!_tableView){

        _tableView = [[UITableView alloc] initWithFrame:CGRectZero style:UITableViewStyleGrouped];
    }
    return _tableView;
}

- (void)viewDidLoad
{
    [super viewDidLoad];


    //_tableView = [[UITableView alloc] init];
    // Do any additional setup after loading the view, typically from a nib.
}

- (void)viewDidUnload
{
    //[self setTableView:nil];
    [super viewDidUnload];
    // Release any retained subviews of the main view.
}

- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
{
    return (interfaceOrientation != UIInterfaceOrientationPortraitUpsideDown);
}

- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView
{
    //warning Potentially incomplete method implementation.
    // Return the number of sections.
    return 2;
}

- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
{
    NSLog(@"asking for rows");
    //#warning Incomplete method implementation.
    // Return the number of rows in the section.
    switch (section)
    {
        case 0:
            return 5;
        case 1:
            return 10;
            break;
        default:
            return 0;
            break;
    }
}

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

    static NSString *CellIdentifier = @"Cell";
    UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];

    if (cell == nil) {
        cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier];
        cell.selectionStyle = UITableViewCellSelectionStyleNone;
    }
    cell.textLabel.text = @"hi";
    return cell;

}

- (NSString *)tableView:(UITableView *)tableView titleForHeaderInSection:(NSInteger)section
{
    return @"testtext";
}


@end

Please tell me what I have done wrong and correct my code.

  • 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-27T21:19:16+00:00Added an answer on May 27, 2026 at 9:19 pm
    1. Add some protocols to your view controller:

      @interface viewViewController : UIViewController

    2. Check to be sure you’re connecting the delegate and datasource properties from tableView to File’s Owner.

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

Sidebar

Related Questions

I have searched around Google and StackOverflow trying to find a solution to this,
I have searched Google and looked here but I haven't quite found the answer
I have googled an serached a lot here about background runnin aps but have
I have searched/Googled around but I'm struggling with the following problem. I am building
I've searched google and SO for a solution to this problem but have not
I have googled a lot and also searched in stackoverflow.com about how to sort
I've searched through stackoverflow and google's extension FAQ but could not seem to find
I have googled and searched this site, but nothing specific appears and cannot get
I have searched Google for the standalone Hibernate/Spring applications, but didn't find any useful
Ok, So I've googled this problem and I have searched stack overflow but 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.