1

今天,我升级到 Xcode 10。今天早些时候用我的 Xcode 9.x 编译的同一个项目现在抱怨我在 Xcode 10.1 中几乎所有的初始化程序。

我试过清理项目并重建,没有运气。我玩过编译器优化级别,没有运气。

示例代码: 片段_1

新 Xcode 10 项目中的相同代码编译得很好。编译器错误的其他实例:

let b = UIButton() // throws "Cannot invoke initializer for type 'UIButton' with no arguments"
//1. Overloads for 'UIButton' exist with these partially matching parameter lists: (type: UIButtonType), (frame: CGRect), (coder: NSCoder), (with: UIColor), (with: ThemeColorPicker)

let l = UILabel() // throws "Cannot invoke initializer for type 'UILabel' with no arguments"

var safeAreaLayoutGuideBottom = UIView()// throws "Cannot invoke initializer for type 'UIView' with no arguments"
4

0 回答 0