Ios 类型';n错误';没有成员';错误与';在swift 4中?
在以下行:Ios 类型';n错误';没有成员';错误与';在swift 4中?,ios,swift,Ios,Swift,在以下行: completionHandler(Result.failure(NSError.errorWith(text: "Can't download video"))) 我得到: 类型“NSError”没有成员“errorWith” 当前的替代方案是什么?它只是意味着n错误没有errorWith方法。如果要创建具有任何描述的n错误,请尝试以下操作 let error = NSError(domain: "SomeErrorDomain", code: -2001 /* some e
completionHandler(Result.failure(NSError.errorWith(text: "Can't download video")))
我得到:
类型“NSError”没有成员“errorWith”
当前的替代方案是什么?它只是意味着
n错误
没有errorWith方法。如果要创建具有任何描述的n错误
,请尝试以下操作
let error = NSError(domain: "SomeErrorDomain", code: -2001 /* some error code */, userInfo: ["description": "Can't download video"])