最近才看ios的书,现在的书大多是在ios6上讲解知识的,用的都是xib。 前几天把xcode升到了xcode5,发现 新建single view application 时没有了viewcontronller.xib。然后自己删掉storyboard,新建一个UIViewController的子类并且生成了xib文件。新建后把项目的主视图也改成了这个新的xib。
在AppDelegate.h 中添加了
@property (strong,nonatomic) LogInViewController *viewController;
在AppDelegate.m中添加了
@synthesize viewController;
self.viewController = [[LogInViewController alloc] initWithNibName:@"LogInViewController" bundle:nil];
self.window.backgroundColor = [UIColor whiteColor];
[self.window addSubview:viewController.view];
每次运行后,都会出现下图这个错误:
真的是被xcode5 整得很不习惯啊。 错在哪里了呢?
xcode5你新建工程的时候,建empty application就可以了