【发布时间】:2015-10-26 18:05:58
【问题描述】:
我正在尝试在教科书中实现此功能,但它不起作用。这本书是在不同版本的 swift 上,所以这可能就是它不起作用的原因。我想知道是否有人知道如何解决这个问题?我正在使用迅速。
override func supportedInterfaceOrientations() -> Int {
return Int(UIInterfaceOrientationMask.Portrait.rawValue) |
Int(UIInterfaceOrientationMask.Landscape.rawValue)
}
错误:方法没有“覆盖”其超类中的任何方法。
当我删除覆盖时,它给了我这个错误:
带有 Objective-C 选择器 'supportedInterfaceOrientations' 的方法 'supportedInterfaceOrientations()' 与具有相同 Objective-C 选择器的超类 'UIViewController' 中的方法 'supportedInterfaceOrientations()' 冲突
【问题讨论】:
-
你看过这个吗? iphonedev.tv/blog/2015/6/23/…