如何解决CCCrypt-iOS 14更新后,表达式类型不明确,没有更多上下文
所以今天早上我按照系统提示将操作系统和XCode更新到iOS 14。
但是,在更新后打开XCode时,遇到错误Type of expression is ambiguous without more context
。我没有更改代码,并且在更新之前可以正常工作。
这是有问题的代码:
let ccStatus = CCCrypt(
Ccoperation(kCCEncrypt),// operation
CCAlgorithm(kAlgorithm),// Algorithm
Ccoptions(kCcoptionPKCS7Padding),// options
realKey?.withUnsafeBytes{$0.baseAddress?.assumingMemoryBound(to: UInt32.self)},// key //realKey.length,// keylength
kCCKeySizeAES256,realIV?.withUnsafeBytes{$0.baseAddress?.assumingMemoryBound(to: UInt32.self)},// iv
data?.withUnsafeBytes{$0.baseAddress?.assumingMemoryBound(to: UInt32.self)},// dataIn
(data?.count ?? 0),// dataInLength,cipherData.withUnsafeMutableBytes{$0.baseAddress?.assumingMemoryBound(to: UInt32.self)},// dataOut
(cipherData.count),// dataOutAvailable
&outLength) // dataOutMoved
我已经尝试了所有我能想到的东西,例如寻找不必要的空间等...我似乎无法弄清楚。任何帮助将不胜感激。
解决方法
好吧,如果以后有人找到它,对我来说,在调用CCCrypt之前创建值是什么。例如,代替:
let ccStatus = CCCrypt(CCOperation(kCCEncrypt),...)
我现在这样做:
let operation = CCOperation(kCCEncrypt)
//other values needed
let ccStatus = CCCrypt(operation,...)
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。