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

标签 iphone ios objective-c parse-platform

我正在使用 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/

相关文章:

iphone - 如何为此代码实现计时器?

ios - NSLocalizedString() 参数 "value"和 "tableName"有什么作用?

iphone - CocoaLumberjack - 如何访问设备上的日志文件?

ios - 如何以编程方式更改UIView子类中的UIView框架?

iphone - 单点触控 : PopToViewController and then pushing one causes views clashing on iPod/iPhone

iphone - 每次留下透明区域时,UIView ContentMode ScaleAspectFit 是否缩放图像

objective-c - 刷新 mkannotation 属性和刷新注释

iphone - 在 iPhone 上接收图像(TCP 客户端)

ios - 快速播放录制的音频

objective-c - 返回类型后空格的 clang 格式样式选项