相关疑难解决方法(0)

swift属性的未知类型名称

我有一个用Swift编写的CustomViewController类和一个用Objective C编写的CustomNavigationController类.我正在尝试将CustomNavigationController作为属性添加到我的CustomViewController中.我已添加#import "CustomNavigationController.h"到我的桥接标题中.

在我的CustomViewController中,我有:

class CustomViewController: UIViewController {

    var navController: CustomNavigationController?
...
//init methods


...


 override func viewDidLoad() {
        super.viewDidLoad()

        //Set up Navigation Controller
        navController = self.storyboard.instantiateViewControllerWithIdentifier("CustomNavigationController") as CustomNavigationController!
}
Run Code Online (Sandbox Code Playgroud)

在我尝试构建和运行之前没有错误...我得到"未知类型名称'CustomNavigationController';你的意思是'UINavigationController'?"

有谁知道它为什么不识别这种类型?

ios swift xcode6

16
推荐指数
3
解决办法
2万
查看次数

标签 统计

ios ×1

swift ×1

xcode6 ×1