gpt4 book ai didi

iphone - 如何使用 parse.com 访问关系中的数据

转载 作者:塔克拉玛干 更新时间:2023-11-01 21:22:57 26 4
gpt4 key购买 nike

我正在使用 Parse.com,我在数据浏览器中有以下表格:User(默认用户表格)和 studyYears。在我的用户表中,我有多个用户。我在用户表中添加了一个关系类型的列,该列引用另一个名为 studyYears 的表。 studyYears 表只包含一个名为 year 的字符串列。

我如何进行查询,以便为用户从 studyYears 表的年份列中获取值?

我希望有人能理解我想要得到的东西。提前致谢!

最佳答案

http://blog.parse.com/2012/05/17/new-many-to-many/状态:

When you fetch the Place object, the objects in the relations won’t be fetched, which is a huge win for a relationship with a large number of objects. Even without fetching all the objects in the relation, you can add objects to the relation using add:. If you wanted to fetch all the objects in the relations, you would do something like:

PFRelation *relation = [place relationForKey:@"likes"];
PFQuery *query = [relation query];
[query findObjectsInBackgroundWithBlock:^(NSArray *results, NSError *error) {
// results contains all the people who liked Sid's BBQ.
}];

关于iphone - 如何使用 parse.com 访问关系中的数据,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16336966/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com