2

I need to get all objects in a class from Parse.com, but my code does not seem to be working.

So far, I have this:

var query = ParseObject.GetQuery("GameScore").OrderBy("score").Limit(10);
query.FindAsync().ContinueWith(t =>
{
    IEnumerable<ParseObject> results = t.Result;
    foreach (var obj in results)
    {
        var score = obj.Get<ParseObject>("score");
        Debug.Log("Score: " + score);
    }
});

However, this does not return anything. I believe it doesn't even enter the loop.

EDIT: The class does exist, the keys are all there.

2
  • Anything related to Unity3D? Commented Mar 10, 2014 at 14:30
  • I'm assigning the first 10 items to different gameobjects (texture, and two texts), but I don't think it has any relevance in this case. Commented Mar 10, 2014 at 14:42

1 Answer 1

2

Figured it out.

var score = obj.Get<ParseObject>("score");

should be

var score = obj.Get<float>("score");
Sign up to request clarification or add additional context in comments.

1 Comment

If i have DateTime field 'ExpiredOn', will this work ? var expiry = obj.Get<DateTime>("ExpiredOn");

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.