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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T06:37:48+00:00 2026-05-23T06:37:48+00:00

I have an iPad app that is not showing a table created programmatically. Where

  • 0

I have an iPad app that is not showing a table created programmatically. Where is the error or what is lacking in my code?

ViewController.h

#import <UIKit/UIKit.h>

@interface deleteViewController : UIViewController <UITableViewDelegate, UITableViewDataSource>{
    UITableView *listTable;
}

@property (nonatomic, retain) UITableView *listTable;
//@property (nonatomic, retain) IBOutlet UITableView *listTable;



@end

ViewController.m

#import "deleteViewController.h"


@implementation deleteViewController
@synthesize listTable;



// Implement viewDidLoad to do additional setup after loading the view, typically from a nib.
- (void)viewDidLoad {
    [super viewDidLoad];


    listTable = [[UITableView alloc] initWithFrame:CGRectMake(0, 0, 200, 200) style:UITableViewStylePlain]; //changed THANKS!!, 

    listTable.delegate = self;
    listTable.dataSource = self;
    //listTable.allowsSelection = TRUE;
    [listTable reloadData];

    //listTable.backgroundColor = [UIColor clearColor];
    [listTable setSeparatorStyle:UITableViewCellSeparatorStyleNone];
    [self.view addSubview:listTable];
}


- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView {
     return 1;
}

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

- (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] autorelease];    
    }

    // Configure the cell...
    //cell.textLabel.text = [yourarray objectAtIndex:indexPath.row];

    return cell;
}


// Override to allow orientations other than the default portrait orientation.
- (BOOL)shouldAutorotateToInterfaceOrientation (UIInterfaceOrientation)interfaceOrientation {
    return YES;
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];

// Release any cached data, images, etc that aren't in use.
}

- (void)viewDidUnload {
    // Release any retained subviews of the main view.
// e.g. self.myOutlet = nil;
}


- (void)dealloc {
    [super dealloc];
}

@end

Doesn’t the table have to show even with out data like an array to show? I had tested this with data from coredata and doesnt show it, so I did this bare-bones test first to show the uitable programmatically.

  • 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-23T06:37:49+00:00Added an answer on May 23, 2026 at 6:37 am

    ended up following the apple documentation duhh

    UITableView *tableView = [[UITableView alloc] initWithFrame:CGRectMake(100, 100, 200, 200)
    
                                                          style:UITableViewStylePlain];
    
    tableView.autoresizingMask = UIViewAutoresizingFlexibleHeight|UIViewAutoresizingFlexibleWidth;
    
    tableView.delegate = self;
    
    tableView.dataSource = self;
    
    [tableView reloadData];
    
    
    //self.view = tableView;
    
    [self.view addSubview: tableView];
    
    [tableView release];
    

    and it shows fine !!, 😉

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

Sidebar

Related Questions

I have an iPad app that I would like to make Universal, however this
I have an iPad app that is set to start in landscape mode. From
I have an iPad app that has 4 buttons on the left side that
I have an iPad app that is doing really well, zero crashed reported by
I have an iPhone/iPad app that I want to port to MacOSX. Most of
I have a graphic-intensive iPad app that features a UIWebView. Using the simulator (iOS
I'm developing an iPhone/iPad app that supports dragging items between table views. Since all
I have an iPhone app that I want to change into an iPad app.
Using iOS 4.3 on an ipad app I have a custom NSOperation that uses
I have a magazine Ipad app that dynamically adds/removes webviews from a scrollview to

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.