【问题标题】:PresentViewController TroubleshootingPresentViewController 故障排除
【发布时间】:2015-06-19 21:50:35
【问题描述】:

在我的 swift 应用程序中,我试图让按钮点击切换视图控制器。这是我正在使用的代码:

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

这会返回错误“无法使用参数列表类型调用'presentViewController')pythTheoremViewController.Type,动画:Bool,完成:nil)

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

【问题讨论】:

    标签: ios swift xcode6


    【解决方案1】:

    如果你的 ViewController-instance 是 pythTheoremViewController,删除 self

    【讨论】:

      【解决方案2】:

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

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 2013-07-15
        • 2010-11-30
        • 2021-09-11
        • 2012-02-18
        • 2011-03-07
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        相关资源
        最近更新 更多