【发布时间】:2016-06-01 16:09:06
【问题描述】:
我有这个错误:
“UIViewController”类型的值没有成员“addSubview”
在这段代码中。你知道为什么吗?
override func viewDidLoad() {
self.currentViewController = self.storyboard?.instantiateViewControllerWithIdentifier("ComponentA")
self.currentViewController!.view.translatesAutoresizingMaskIntoConstraints = false
self.addChildViewController(self.currentViewController!)
self.addSubview(self.currentViewController?.view, toView: self.containerView)
super.viewDidLoad()
【问题讨论】: