Cannot call value of non-function type 'String'

前端 未结 6 1809
情书的邮戳
情书的邮戳 2021-01-17 07:35

I\'m trying to pass the ILTItem variable into my ILTViewController, triggered by AppDelegate.swift when the user launches my app via a deeplink.

The code I have erro

6条回答
  •  遥遥无期
    2021-01-17 08:04

    So I had a problem with a similar error message. I am writing a structure to handle Scalars for my library and needed a square root. Error was

    Cannot call value of non-function type 'Vsip.Scalar'

    when calling sqrt. Fixed it by explicitly calling sqrt as shown below. Hope this helps.

    public var sqrt: Scalar {
            switch self.type {
            case .f:
                return Scalar(sqrtf(self.realf))
            case .d:
                let x = Foundation.sqrt(self.reald)
                return Scalar(x)
            case .cf:
                return Scalar(vsip_csqrt_f(self.vsip_cf))
            case .cd:
                return Scalar(vsip_csqrt_d(self.vsip_cd))
            default:
                precondition(false, "sqrt not supported for type \(self.type)")
            }
        }
    

提交回复
热议问题