You have to return at least 1 section... I've tested this in a newly created UIViewController XIB called testes (add new .h and .c files and check the box to created XIB with it and also to make it a UITableViewController subclass) and it works fine.
How did you create the tableview? Did you create it's own XIB like I wrote above or did you just throw a tableview into the MainWindow.xib file? Try creating you own and you should be good. Just make sure in AppDelegate to set the main view that gets added on didFinishLaunchingWithOptions
to the new tableview you create. In IB, the UIViewController for the tableview should be set to testes subclass (which is a UITableViewController subclass)
App Delegate files
#import <UIKit/UIKit.h>
@class testes;
@interface testesAppDelegate : NSObject <UIApplicationDelegate> {
UIWindow *window;
testes *viewController;
}
@property (nonatomic, retain) IBOutlet UIWindow *window;
@property (nonatomic, retain) IBOutlet testes *viewController;
@end
and
#import "testesAppDelegate.h"
#import "testes.h"
@implementation testesAppDelegate
@synthesize window;
@synthesize viewController;
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
// Override point for customization after app launch
[window addSubview:viewController.view];
[window makeKeyAndVisible];
return YES;
}
And then in the viewcontroller .m file
#pragma mark Table view methods
- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView
{
return 1;
}
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
{
return 10;
}