I'm trying to simply view an empty table on my iPhone simulator (with Xcode 4.2), but somehow I don't know what I did wrong. Right now it shows nothing than a plain white page. Actually It should show me a table.
For note: I'm following the instructions of Big Nerd Ranch's Guide "iPhone Programming", Chapter 10.
So right now I have 4 files of my Homepwner-App:
- HomepwnerAppDelegate.m
- HomepwnerAppDelegate.h
- ItemsViewController.h
- ItemsViewController.m
the "ItemsViewController" is a Subclass of the UITableViewController.
ItemsViewController.h
# import <UIKit/UIKit.h>
@interface ItemsViewController : UITableViewController
@end
ItemsViewController.m
isn't filled with interesting stuff right now
HomepwnerAppDelegate.h
# import <UIKit/UIKit.h>
@class ItemsViewController;
@interface HomepwnerAppDelegate : NSObject <UIApplicationDelegate> {
UIWindow *window;
ItemsViewController *itemsViewController; }
@property (nonatomic, retain) IBOutlet UIWindow *window;
@end
HomepwnerAppDelegate.m
#import "HomepwnerAppDelegate.h"
#import "ItemsViewController.h"
@implementation HomepwnerAppDelegate
@synthesize window = _window;
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
//Create a ItemsViewController
itemsViewController = [[ItemsViewController alloc] init];
//Place ItemsViewController's table view in the window hierarchy
[window addSubview:[itemsViewController view]];
[window makeKeyAndVisible];
return YES;
}
@end
The console says: Homepwner[2400:207] Applications are expected to have a root view controller at the end of application launch
I know that there are already other threads with same error message and lots of them link at the "didFinishLaunchingWithOptions:"- Method, but since they offered so many solutions, I'm quite confused now, especially because I just followed the instructions of the book and nothing more... I've just got the feeling that I declared something wrong. How to solve the problem?