【发布时间】:2016-03-17 06:48:43
【问题描述】:
我正在尝试从标识符实例化 UITabBarController,但遇到以下错误:
Cannot assign value of type 'UIViewController' to type 'UITabBarController'
这是有问题的代码:
if NSUserDefaults.standardUserDefaults().boolForKey("LoginPage") == true
{
tabBarController = k_Storyboard.instantiateViewControllerWithIdentifier("TabbarController") //------Error Showed in this Line.
self.window!.rootViewController = tabBarController
UITabBarItem.appearance().setTitleTextAttributes([NSForegroundColorAttributeName: UIColor.whiteColor()], forState: .Selected)
UITabBarItem.appearance().setTitleTextAttributes([NSForegroundColorAttributeName: UIColor(red: 246 / 255.0, green: 206 / 255.0, blue: 206 / 255.0, alpha: 1.0)], forState: .Normal)
isFirstPage = true
}
【问题讨论】:
-
有什么错误请发帖。
标签: swift compiler-errors type-safety