UIViewController 没有成员隐藏底部栏何时推送



我突然开始收到这个编译器错误。昨天还好!(iOS 10.2)

类型为"UIViewController"的值没有成员"hidesBottomBarWhenPushed"

override func prepare(for segue: UIStoryboardSegue, sender: Any?)内设置此segue.destination.hidesBottomBarWhenPushed = true

更新:它仅在模拟器上运行时发生。在实际设备上很好。

类型为"XXX"

的值没有成员"XXX"

在调用方法或设置不存在的属性值时,您会得到上述 Swift 编译器错误消息。

例子

/* Static members */
UIViewController.thisPropertyDoesntExist = true
UIViewController.thisMethodDoesntExist()
/* Instance members */
let vc = UIViewController()
vc.thisPropertyDoesntExist = true
vc.thisMethodDoesntExist()

溶液

Xcode -> 产品 -> 清理构建文件夹并重新构建应用程序

最新更新