[英]adding data to a table which has a pointer column parse.com
i want to add some data to parse.com table called -"stack". 我想将一些数据添加到parse.com表中,称为“堆栈”。 which has a mutliple columns and a pointer called "User". 它具有多个列和一个称为“用户”的指针。 how can i add/update data to a table. 我如何向表添加/更新数据。
ParseObject flytagdata = new ParseObject("stack");
flytagdata.put("Tag", sb.toString());
flytagdata.put("Username", Constant.FB_USERNAME);
flytagdata.put("UserFBId", Constant.FB_USERID);
flytagdata.put("User", ParseUser.getCurrentUser().getObjectId());//pointer column data
flytagdata.saveInBackground();
For Parse.com pointers, you always pass the object itself instead of the objectId. 对于Parse.com指针,您总是传递对象本身而不是objectId。
Like so: 像这样:
ParseObject flytagdata = new ParseObject("stack");
flytagdata.put("Tag", sb.toString());
flytagdata.put("Username", Constant.FB_USERNAME);
flytagdata.put("UserFBId", Constant.FB_USERID);
flytagdata.put("User", ParseUser.getCurrentUser());//FIXED THIS LINE
flytagdata.saveInBackground();
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.