解析为Android不能针子列表缓存 [英] Parse for Android can't pin List of subclass to cache

查看:194
本文介绍了解析为Android不能针子列表缓存的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

正如 HTTP表明:// blog.parse.com/2013/05/30/parse-on-android-just-got-classier/~~V 解析现在支持的parseObject的子类。我的问题边棱,​​当我尝试针我的检索列表 发表从我的查询对象的缓存。

As indicated by http://blog.parse.com/2013/05/30/parse-on-android-just-got-classier/ Parse now supports subclassing of ParseObject. My issue arrises when I try to "pin" my retrieved List of Post objects from my query to the cache.

发表的parseObject

   ParseQuery<Post> query = ParseQuery.getQuery(Post.class);
    query.orderByDescending("updatedAt");

    // Gets all posts from Parse.
    query.findInBackground(new FindCallback<Post>() {
        @Override
        public void done(final List<Post> posts, ParseException e) {
            if (e != null) {
                // There was an error or the network wasn't available.
                return;
            }

            // Nothing to update.
            if (posts.size() == 0) {
                return;
            }

            // Add the latest Posts from this query to the local cache.
            Post.pinAllInBackground(POST_CACHE_LABEL, posts);
            updateMapFromCache();
        }
    });

ParseObject.pinAllInBackground()只接受列表&LT;的parseObject&GT; 不是名单,LT ;? &GT; 这是现在我创造的一个问题。有没有人有过解决这个迭代之外名单&LT;邮政和GT; 并单独寄希望于他们

ParseObject.pinAllInBackground() only accepts List<ParseObject> not List<?> which is now creating an issue for me. Does anyone have a solution to this besides iterating through List<Post> and pinning them individually?

感谢您的帮助!

推荐答案

这不是一个答案,但我没有足够的回购协议发表评论。

我有同样的问题,一旦PraseObject的子类的一个对象被存储在本地数据存储。
我能找回它的应用程序运行时,一旦重新启动应用程序,我从类似于上面的查询得到的是的parseObject的名单,而不是我的自定义对象的名单。
现在我所做的是,创造了一个自定义分析器重建我的自定义实现的对象。但是,这违背了什么是在指定的用途的 http://blog.parse.com/2013/05/30/parse-on-android-just-got-classier/

I am having this same problem, once a object of subclass of PraseObject is stored in local data store. I am able to retrieve it while the application is running, once application is restarted, what I get from a query similar to above is a list of ParseObject's and not a list of my custom object. For now what I did is, created a custom parser to recreate a object of my custom implementation. But this defeats the purpose of what is indicated in "http://blog.parse.com/2013/05/30/parse-on-android-just-got-classier/".

这篇关于解析为Android不能针子列表缓存的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆