PresentViewController故障排除

时间:2015-06-19 21:50:36

标签: ios swift xcode6

在我的swift应用程序中,我正在努力使按钮水龙头切换视图控制器。这是我正在使用的代码:

presentViewController(pythTheoremViewController.self, animated: true, completion: nil)

这将返回错误“无法使用类型'的参数列表调用'presentViewController'”pythTheoremViewController.Type,animated:Bool,completion:nil)

这是什么意思,我该如何解决?

2 个答案:

答案 0 :(得分:1)

如果您的ViewController实例是pythTheoremViewController,请删除self

答案 1 :(得分:0)

抱歉这个愚蠢的问题!当我在视图控制器名称之后使用()时,我使用了自动更正.self选项。