无法转换类型的值&#AES; AES'预期的参数类型' UnsafeRawPointer?'

时间:2017-01-17 08:27:31

标签: ios swift type-conversion unsafe unsafemutablepointer

我对此代码有些疑问:

import UIKit
import Foundation
import CryptoSwift
class StartViewController: UIViewController {
override func viewDidLoad() {
        super.viewDidLoad()
let key = "bbC2H19lkVbQDfakxcrtCCQdd0FloLyw" 
        let iv = "gqLOHUioQ0QjhusP" 
        let s = "my test string"
do {
            let data = s.data(using: .utf8)
            let enc = try AES(key:key,iv:iv,blockMode:.CBC,padding:PKCS7())
            let encData = NSData(bytes:enc,length:Int(enc.count))

        } catch {
            print("error")
        }
}  

现在告诉我这个错误:

Cannot convert value of type 'AES' to expected argument type 'UnsafeRawPointer?'  

0 个答案:

没有答案