我的工作表視圖應用程序,我得到了這種類型的運行時錯誤的:應用程序在應用程序啓動結束時應該有一個根視圖控制器?
Applications are expected to have a root view controller at the end of application launch
任何建議和示例代碼的預期。
我的工作表視圖應用程序,我得到了這種類型的運行時錯誤的:應用程序在應用程序啓動結束時應該有一個根視圖控制器?
Applications are expected to have a root view controller at the end of application launch
任何建議和示例代碼的預期。
警告意味着,在您的應用程序委託的application:didFinishLaunchingWithOptions:
方法,你應該指定一個視圖控制器作爲主窗口的rootViewController
:
self.window.rootViewController = myRootViewController;
這裏是從單個視圖應用程序的標準執行。需要注意的是一個視圖控制器分配和初始化,然後分配給self.window.rootViewController
您的應用程序就會有這樣的事情,但不知何故,你已經失去了/刪除self.sindow.rootViewController分配
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
self.window = [[[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]] autorelease];
// Override point for customization after application launch.
self.viewController = [[[ViewController alloc] initWithNibName:@"ViewController" bundle:nil] autorelease];
self.window.rootViewController = self.viewController;
[self.window makeKeyAndVisible];
return YES;
}