我有一个重置用户密码的方法,我正在异步地发出这个请求。抛出此错误的行如下:
authController.resetPasswordAsyncWithEmail(["email": email]) { (success, context, _, error) -> Void in
...
“上下文类型'NSObject'不能与字典文字”
一起使用resetPasswithAsyncWithEmail如下:
- (void) resetPasswordAsyncWithEmail:(NSObject*) email
completionBlock:(CompletedPostResetPassword) onCompleted
{
....
}
我该如何解决此问题?
答案 0 :(得分:1)
必须稍微更改方法的术语并将字典转换为NSObject,如下所示:
authController.resetPasswordAsync(withEmail: ["email": email] as NSObject!) { (success, context, _, error) -> Void in
答案 1 :(得分:1)