我想从Parse.com上检索一个数据对象列表,但我不知道你怎么能帮助我
这是我的代码
Calendar cal = Calendar.getInstance();
cal.set(2015, 8, 12, 0, 0, 0);
Calendar sswal = Calendar.getInstance();
sswal.set(2015, 8, 12, 23, 30, 0);
Date dd = cal.getTime();
Date mok =sswal.getTime();
final ParseObject[] most = new ParseObject[10];
ParseQuery<ParseObject> query = ParseQuery.getQuery("RashedHospitalMonthSchedule");
query.whereGreaterThanOrEqualTo("appointDate", dd);
query.whereLessThanOrEqualTo("appointDate", mok);
query.getFirstInBackground(new GetCallback<ParseObject>() {
@Override
public void done(ParseObject parseObject, com.parse.ParseException e) {
if (parseObject == null) {
Log.d("score", "The getFirst request failed.");
} else {
for (int i=0;i<10;i++)
{
most[i].getParseObject(String.valueOf(parseObject));
}
}
}
});
................
提前谢谢
答案 0 :(得分:0)
使用findInBackground()而不是使用getFirstInBackground()。 getFirstInBackground只返回1个ParseObject,而findInBackground()将返回一个ParseObjects列表。