【问题标题】:How to access Parse.com Relation Data如何访问 Parse.com 关系数据
【发布时间】:2015-09-28 13:53:11
【问题描述】:

我需要来自用户的数据来提问。我已经和单独访问数据(_User 和 Question 数据),但我需要关系访问。例如,我需要从 _User 类访问问题标题。

【问题讨论】:

    标签: android parse-platform relation


    【解决方案1】:

    这可能有效。以下将回答当前登录用户的问题。

    ParseUser user = ParseUser.getCurrentUser();
    ParseRelation<ParseObject> relation = user.getRelation("question_id");
    relation.getQuery().findInBackground(new FindCallback<ParseObject>() {
        void done(List<ParseObject> results, ParseException e) {
          if (e != null) {
            // There was an error
          } else {
            // results have all the questions
          }
        }
    });
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2017-08-07
      • 2014-08-24
      • 1970-01-01
      • 1970-01-01
      • 2012-09-19
      相关资源
      最近更新 更多