建立Empty Application,新建Storyboard并添加View Controller 控件后运行为空白,并报错
控制台显示:
2012-07-18 15:21:57.338 apress-8[664:f803] Application windows are expected to have a root view controller at the end of application launch
通过和Single View Application模版对比发现:需要至少修改两个地方:
1、AppDelegate.m
1 - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions 2 { 3 /* 4 self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]]; 5 // Override point for customization after application launch. 6 self.window.backgroundColor = [UIColor whiteColor]; 7 [self.window makeKeyAndVisible]; 8 */ 9 return YES; 10 }
2、项目配置,添加Main Storyboard