菜鸟教程小白 发表于 2022-12-12 13:36:45

ios - 在 Parse 中查询嵌套对象


                                            <p><p>我试图掌握这里的模式。如果我有属于用户 (PFUsers) 的“期刊”,我如何查询属于该用户的所有期刊?我认为这是不对的,但一种方法是在所有期刊对象上设置用户名,因为我知道它是唯一的,然后使用该用户名查询所有期刊。这是最好的方法吗?似乎应该有一种更干净的方式来处理关系。</p></p>
                                    <br><hr><h1><strong>Best Answer-推荐答案</ strong></h1><br>
                                            <p><p>在 <a href="https://www.parse.com/docs/ios_guide#users-associations/iOS" rel="noreferrer noopener nofollow">iOS guide</a> 中找到了我的问题的答案.我对“嵌套”的搜索没有找到它。 “协会”做到了:)。</p>

<pre><code>PFUser *user = ;

// Make a new post
PFObject *post = ;
;
;
;
;

// Find all posts by the current user
PFQuery *query = ;
;
NSArray *usersPosts = ;
</code></pre></p>
                                   
                                                <p style="font-size: 20px;">关于ios - 在 Parse 中查询嵌套对象,我们在Stack Overflow上找到一个类似的问题:
                                                        <a href="https://stackoverflow.com/questions/18239482/" rel="noreferrer noopener nofollow" style="color: red;">
                                                                https://stackoverflow.com/questions/18239482/
                                                        </a>
                                                </p>
                                       
页: [1]
查看完整版本: ios - 在 Parse 中查询嵌套对象