解析数据库中的 ParseUser.getList()

编程入门 行业动态 更新时间:2024-10-24 18:22:08
本文介绍了解析数据库中的 ParseUser.getList()的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

限时送ChatGPT账号..

我正在创建一个类似推特的应用程序,我们可以在其中关注其他用户并阅读他们的推文.

I am creating a twitter like app where we can follow other users and read their tweets.

ParseUser.getCurrentUser().getList("isFollowing").remove(users.get(position));
List<String> tmpUsers=ParseUser.getCurrentUser().getList("isFollowing");
ParseUser.getCurrentUser().remove("isFollowing");
ParseUser.getCurrentUser().put("isFollowing", tmpUsers);

上面的代码在用户想要取消关注时运行.

The above code runs when user wants to unfollow.

我有一个疑问:

ParseUser.getCurrentUser().getList("isFollowing").remove(users.get(position));
List<String> tmpUsers=ParseUser.getCurrentUser().getList("isFollowing");

当我们使用 ParseUser.getCurrentUser().getList("isFollowing").remove(users.get(position));我们是从数据库下载列表并在本地删除元素吗?

when we are using ParseUser.getCurrentUser().getList("isFollowing").remove(users.get(position)); are we downloading the list from the database and removing the element locally?

当我们运行List时tmpUsers=ParseUser.getCurrentUser().getList("isFollowing"); 我们是再次下载列表还是获取删除了 users.get(position) 的列表?

When we run List<String> tmpUsers=ParseUser.getCurrentUser().getList("isFollowing"); are we downloading the list again or are we getting the list which has users.get(position) removed?

推荐答案

您不是在下载"任何这些行中的列表.您正在访问已缓存在设备中的列表.为了获取您需要使用的最新数据:

You are not "downloading" the list in any of these lines. You are accessing the list that is already cached in your device. In order to fetch the latest data you need to use:

ParseUser.getCurrentUser().fetch();

这篇关于解析数据库中的 ParseUser.getList()的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

更多推荐

[db:关键词]

本文发布于:2023-04-16 08:00:31,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/881937.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:数据库中   ParseUser   getList

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!