0

parse4j用来工作Parse.com

我正在做一个循环以在启动时从服务器检索所有数据....

除了我的代码是:

ParseObject lastObj = subList.get(subList.size() - 1);
System.out.println(new Gson().toJson(lastObj));
System.out.println("createAt: " + lastObj.get("createdAt"));

结果是:

{"objectId":"l2ncgKp0SG","className":"URLMapping","endPoint":"classes/URLMapping","isDirty":false,"data":{"shortUrl":"ilx","owner_id":"5e32a370-4d8f-4032-ad2d-d0a31aff5c77","originalUrl":"http://google.com","ip":"10.226.123.45"},"operations":{},"dirtyKeys":[],"updatedAt":"May 5, 2014 9:02:59 AM","createdAt":"May 5, 2014 9:02:59 AM"}
createAt: null

那么,对象值如何存在,但parse4j说它是null

4

1 回答 1

0

对于内置字段,应该使用诸如createdAt()...之类的方法objectId(),因为 getXXX 不适用于内置字段。

于 2014-05-05T16:12:20.647 回答