Command failed due to signal: Abort trap: 6

前端 未结 30 2217
暖寄归人
暖寄归人 2020-12-01 08:56

Since Xcode 7 and Swift 2.0, I get the error above, like in the screenshot shown here:

\"screenshot

30条回答
  •  有刺的猬
    2020-12-01 09:41

    I got this message when using do-try-catch in a Failable initializer:

    public init?() {
        do {
            ...
            super.init(superParam: try getParamForSuper())
            ...
        } catch {
            ...
        }
    }
    

    The compilation succeeded when moving the try call to it's own local variable:

    public init?() {
        do {
            ...
            let superParam = try getParamForSuper()
            super.init(superParam: superParam)
            ...
        } catch {
            ...
        }
    }
    

提交回复
热议问题