android:解析具有空值的对象

时间:2016-01-17 00:12:02

标签: android parse-platform

我有一个检索解析对象的查询: 我试图调试回调函数,我发现我得到了正确数量的对象,但它们的所有值都为空。 虽然有一个叫做“州”的价值,但我得到了这些价值观 我究竟做错了什么?我如何正确地获得价值?

  final List<Kehila> newKehilas = new ArrayList<>();
    ParseQuery<ParseObject> query = ParseQuery.getQuery("Kehila");
    query.findInBackground(new FindCallback<ParseObject>() {

        @Override
        public void done(List<ParseObject> list, ParseException e) {
            if (e != null) {
                Log.e("UNITE", e.toString());
            } else {

                for (ParseObject k : list) {

                    Kehila newKehila = new Kehila();
                    newKehila.setObjectId(k.getString("objectId"));
                    newKehila.setName(k.getString("name"));
                    newKehila.setCity(k.getString("city"));
                    newKehila.setNeighborhood(k.getString("neighborhood"));
                    newKehila.setStreet(k.getString("street"));
                    newKehila.setHouseNumber(k.getInt("houseNumber"));

                    newKehilas.add(newKehila);
                }
            }

        }
    });
   return newKehilas;

1 个答案:

答案 0 :(得分:0)

我认为您需要在新对象上调用$.ajax({ type: 'POST', url: '/your_url', data: { course: { name: 'Hello World', price: 120 } } }); class ProductController < ApplicationController def create @product = Product.create(product_params) end private def product_params params.require(:product).permit(:name, :price) end end