2015-09-28 57 views
0

我需要用戶的數據來提問。我已經和單獨訪問數據(_用戶和問題數據),但我需要關係access.For前我需要從_User類訪問問題標題。如何訪問Parse.com關係數據

enter image description here

enter image description here

回答

0

這可能會實現。以下內容將採用當前登錄用戶的問題。

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 
     } 
    } 
});