私のiPhoneシミュレータ(Xcode 4.2)で空のテーブルを表示しようとしていますが、どういうわけか何がわかりません私は間違いをした。今は普通の白いページだけを示しています。実際にはそれは私にテーブルを表示する必要があります。注エラーメッセージ "アプリケーションの起動時にルートビューコントローラが必要です"
:
- HomepwnerAppDelegate:私はビッグオタクランチ者ガイド「iPhoneプログラミング」、第10章
の指示に従うよだから、今、私は私のHomepwnerアプリの4つのファイルを持っています.M
- HomepwnerAppDelegate.h
- ItemsViewController.h
- ItemsViewController.m
「ItemsViewController」は、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
コンソールは言う:Homepwner [2400:207]アプリケーションが
は、私が知っているアプリケーションの起動の最後にルートビューコントローラを有することが期待されます"didFinishLaunchingWithOptions:"メソッドでリンクされている同じエラーメッセージを持つ他のスレッドが既に存在していますが、それらは非常に多くのソリューションを提供して以来、私はかなり混乱しています。もう何も...私はちょうど私は何か間違ったと宣言した。 どのように問題を解決するには?
この質問は役に立ちますか? http://stackoverflow.com/questions/7520971/applications-are-expected-to-have-a-root-view-controller-at-the-end-of-applicati – trojanfoe
私はすでに最初のものを試しました、それdoesn助けてください。たぶん、私はすべての答えを試す時間を投資する必要があります。 – Kirinriki
ええ、それは確かにここですでに答えられています。 – trojanfoe