升级xcode.6以后发现视图无法显示。(这是apple大力推荐使用xib和sb的结果)
解决如下:
1.创建single view application后,在info.plist删除
2. 删除Main.storyboard以及LaunchScreen.xib
3.在appdelgete中添加代码如下
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
// Override point for customization after application launch.
self.window.backgroundColor=[UIColor whiteColor];
self.window = [[UIWindow alloc]initWithFrame:[[UIScreen mainScreen]bounds]];
ViewController *vc = [[ViewController alloc]init];
[self.window setRootViewController:vc];
[self.window makeKeyAndVisible];
return YES;
}