ボタンをクリックして、TabbedController ページから UITableView ビューを起動しています。
UITableView の例は、YouTube にある LuisEGarza の優れた UITableView の例から取られたもので、私の考えでは完璧なラインです。コードはコンパイルされますが、UITableView ページが表示されると空白になります。これは TabbedController の問題ですか、それとも何か間違ったことをしたのでしょうか?
以下は、サンプルの .m および .h ファイルです。
//
//  SolarResultsTableViewController.h
//  Solar
//
//  Created by Edward Hasted on 08/05/2012.
//  Copyright (c) 2012 EHC. All rights reserved.
//
#import <UIKit/UIKit.h>
@interface SolarResultsTableViewController : UIViewController  <UITableViewDelegate, UITableViewDataSource> {
    NSArray *tableData;
    // IBOutlet UILabel *rowLabel;
}
@property (nonatomic, retain) NSArray *tableData;
@end
//
//  SolarResultsTableViewController.m
//  Solar
//
//  Created by Edward Hasted on 08/05/2012.
//  Copyright (c) 2012 EHC. All rights reserved.
//
#import "SolarResultsTableViewController.h"
@implementation SolarResultsTableViewController 
@synthesize tableData;
- (void)viewDidLoad
{
    tableData = [[NSArray alloc] initWithObjects:@"A", @"B", @"C", @"D", nil];
    [super viewDidLoad];
    // Do any additional setup after loading the view.
}
#pragma mark - TableView Data Source methods
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section 
{
    // rowLabel.text = [NSString stringWithFormat:@"%d", count];
    return [tableData count];
}
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath 
{
    UITableViewCell *cell = nil;
    cell = [tableView dequeueReusableCellWithIdentifier:@"MyCell"];
    if (cell == nil)
            { 
                cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:@"MyCell"];
            }
    cell.textLabel.text = [tableData objectAtIndex:indexPath.row];            
    return cell;
}
- (void)didReceiveMemoryWarning {
    // Releases the view if it doesn't have a superview.
    [super didReceiveMemoryWarning];
    // Release any cached data, images, etc that aren't in use.
}
- (void)viewDidUnload
{
    [super viewDidUnload];
    // Release any retained subviews of the main view.
}
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
{
    return (interfaceOrientation == UIInterfaceOrientationPortrait);
}
@end