Xamarin IOS和Parse无法更新现有对象

时间:2014-01-29 23:08:09

标签: xamarin parse-platform

我正在尝试将parse.com与xamrian ios一起使用,但我似乎无法弄清楚如何使用。应该但它似乎不喜欢公众电话。他们是另一种在xamrian ios中检索和更新对象的方法吗?

// Retrieve the object by id
                ParseQuery query = new ParseQuery("UserName");
                query.getInBackground("tJLv7tTacZ", new GetCallback() {
                    public void done(ParseObject object, ParseException e) {
                        if (e == null) {
                            object.put("Name", username);
                            object.saveInBackground();
                        } else {
                            // do something with the error...
                        }
                    }
                });

1 个答案:

答案 0 :(得分:0)

尝试使用新的GetCallback<ParseObject>()

ParseQuery<ParseObject> query = ParseQuery.getQuery("MyClass");
 query.getInBackground(myId, new GetCallback<ParseObject>() {
     public void done(ParseObject object, ParseException e) {
         if (e == null) {
             objectWasRetrievedSuccessfully(object);
         } else {
             objectRetrievalFailed();
         }
     }
 }