在 Parse 中查询带有指针数组的对象 [英] Query for Objects with Pointer Array in Parse

查看:33
本文介绍了在 Parse 中查询带有指针数组的对象的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

  • 我有一个名为 restaurantsArray[PFObjects] 数组.
  • 在 Parse 中,有一个类:FoodPhotos,带有指向 RestaurantName 的指针(restaurantsArray 中的对象)
  • I have an array of [PFObjects] called restaurantsArray.
  • Within Parse, there is a Class: FoodPhotos with pointers to RestaurantName (the objects in restaurantsArray)

如何查询 FoodPhotos 中包含指向 restaurantsArray 中对象的指针的所有对象.

How can I query for all objects within FoodPhotos that contain the pointer to an object in restaurantsArray.

基本上我想获取所有包含指向 restaurantArray

Basically I want to grab all the Food Photos that contain a pointer to an object in restaurantArray

推荐答案

我现在无法测试此代码以确保其有效,但您可以尝试以下操作:

I can't test this code right now to be sure it works, but you could try something like the following:

PFQuery *query = [FoodPhotos query]; // Or ... = [PFQuery queryWithClassName:@"FoodPhotos"];
[query whereKey:@"RestaurantName" containedIn:restaurantArray];

这应该只返回 RestaurantName 列与 restaurantArray 中的对象之一匹配的 FoodPhotos 对象.

This should only return FoodPhotos objects who's RestaurantName column matches one of the objects in restaurantArray.

这篇关于在 Parse 中查询带有指针数组的对象的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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