我正在尝试使用指定的初始化器和 xib 文件 View.xib 来实例化一个 UIViewController
var appBundle = NSBundle.mainBundle()
var controller = UIViewController.init(nibName: "View", bundle: appBundle)
但是我得到了编译错误:
Command /Applications/Xcode6-Beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/swift failed with exit code 254
还有其他人遇到这个错误吗?我不知道我做错了什么。
最佳答案
试试这个:
var appBundle = NSBundle.mainBundle()
var controller = UIViewController(nibName: "ViewController", bundle: appBundle)
关于swift - Swift 中的 UIViewController 初始化抛出编译错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/24096202/