UIViewController没有成员hidesBottomBarWhenPushed

时间:2017-01-30 06:42:49

标签: ios swift3 uicontainerview

我突然开始收到此编译错误。昨天天气很好! (iOS 10.2)

  

类型的价值' UIViewController'没有会员&hidesBottomBarWhenPushed'

segue.destination.hidesBottomBarWhenPushed = true

中设置此override func prepare(for segue: UIStoryboardSegue, sender: Any?)

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

1 个答案:

答案 0 :(得分:0)

“ XXX”类型的值没有成员“ XXX”

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

示例

/* Static members */
UIViewController.thisPropertyDoesntExist = true

UIViewController.thisMethodDoesntExist()

/* Instance members */
let vc = UIViewController()

vc.thisPropertyDoesntExist = true

vc.thisMethodDoesntExist()

解决方案

Xcode->产品->清理生成文件夹并重新生成应用