无法在ParseUser上保存字典 [英] Unable to save Dictionary on ParseUser

查看:84
本文介绍了无法在ParseUser上保存字典的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

试图将Dictionary保存为ParseUser对象上的字段,但是不起作用.这很简单:

Trying to save a Dictionary as a field on a ParseUser object, but its not working. Its a pretty straightforward:

//updateDict does implement IDictionary<string,T>

    ParseUser.CurrentUser["ItemsStatus"]= updateDict;

    ParseUser.CurrentUser.SaveAsync()

我已经检查了字典是否具有值,并且如果删除了对字典字段的更新,则可以毫无问题地保存用户.但是,如果我尝试添加该值,则在调用保存任务时,解析只会得到400 Bad Request"Other Cause"响应.有什么想法吗?

I've already checked to see if my dictionary has values, and I can save the user without issue if I remove the update to the dictionary field. But if I try to add that value I just get a 400 Bad Request "Other Cause" response from parse when I call the save task. Any thoughts?

推荐答案

字典不是有效的Parse数据类型.

A dictionary is not a valid Parse data type.

您需要将字典中的元素单独添加到User对象,或者使用updateDict中的元素创建一个新的Parse对象并与其建立关系.

You need to either add the elements of the dictionary to the User object individually or create a new Parse object with the elements from updateDict and create a relation to that.

这篇关于无法在ParseUser上保存字典的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆