本文介绍了如何在 xcode 6 (swift) 中创建没有故事板的项目?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
有没有人练习过在没有故事板的情况下在 xcode6 (swift) 中创建项目.
Can any one has practiced creating project in xcode6 (swift) without storyboard.
我能够实施
func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: NSDictionary?) -> Bool {
// Override point for customization after application launch.
self.window = UIWindow(frame: UIScreen.mainScreen().bounds)
self.window!.backgroundColor = UIColor.whiteColor()
self.window!.makeKeyAndVisible()
var viewController: ViewController? = ViewController(nibName: "ViewController", bundle: nil)
self.navigationController = UINavigationController(rootViewController: viewController)
self.window!.rootViewController = self.navigationController
return true
}
但它失败并出现以下错误
but it fails with following error
*** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason:
'-[UIViewController _loadViewFromNibNamed:bundle:] loaded the "ViewController" nib but the
view outlet was not set.'
所以我试图将文件的所有者 UIView 与 xib 相关联,但我无法在文件的所有者属性中看到 UIView.
so i tried to relate file's owner UIView with xib, but i am unable to see UIView in file's owner property.
见下图
编辑
谢谢亚历克斯,但从 此处 我找不到任何视图.见附上的屏幕
Thanks Alex but from the second last point from HERE i am unable to find any view.See the screen attached
推荐答案
我解决了我的问题..
看屏幕
xcode6 beta 有点奇怪,我不确定它有什么问题.
Something strange with xcode6 beta, i am not sure whats wrong with it.
这篇关于如何在 xcode 6 (swift) 中创建没有故事板的项目?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!