问题标签 [pfquery]
For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.
ios - 查询不返回最新的对象
我在我的应用程序中使用 Parse。我正在尝试执行一个限制为 10 个对象的查询,该对象按 createdAt 属性的降序排序,而且我正在使用该nearGeopoint:WithinKilometers
函数。当我运行查询时,接收数据库中最旧的对象。当我删除要返回的对象数量的限制时,查询会从最新到最旧(如预期的那样)返回最新的对象。限制这样做吗?这不是一个错误吗?这是代码,如果有什么问题请告诉我:
ios - 使用 PFQuery 的 containsAllObjectsInArray 会导致错误
我有以下代码,我尝试根据一组用户 ID 检索用户:
但是,我总是收到错误“ Error: $all only works on array fields (Code: 102, Version: 1.2.18)
”。我不太确定自己做错了什么,因为我将数组作为查询项传递。
谢谢!
ios - How does a (nonatomic, strong) property's lifespan work in iOS?
Say I have a property declared as : @property (nonatomic, strong) NSArray *menuArr;
OR @property (strong) NSArray *menuArr;
and set this property in viewDidLoad
. How long will the device "remember" the information I have stored in the array?
The property is declared and set in a viewController that is embedded in a navigationViewController that is itself the first view controller in a TabBarViewController. In other words its the first view the user sees then they may navigate away from it and back.
Without getting into a debate over atomic vs nonatomic my question is this
Does a property (declared either way) lives on infinitely in the iOS environment or is its lifespan limited by factors such as time, memory usage elsewhere, turning off the device, etc
To avoid this being an "x y problem" here's why Im asking:
Im working on an app that includes a menu broken up into multiple categories with several items in each category .....as you might expect a menu to be. All of the menu items are stored on parse.com. At first I was doing a separate PFQuery on each page, one on the categories page to get the categories, when user selects a category a new page is pushed and a second PFQuery got all the items in the chosen category. This worked but the pages took quite a while to load, probably 10-15 seconds sometimes with no real indication that the app hadnt just frozen up.
To fix this I decided to run one PFQuery when the first view of the app is loaded in viewDidLoad
getting all of the menu items and sorting the myself into nested arrays of categories containing items. I then store the menu array in a property on the viewController. Later, when I go to the menu I have the below in it's viewDidLoad
:
My understanding is that this creates a pointer to the original array and does not actually create a second array (please correct me if Im wrong).
This method takes about 10-15 seconds to load and sort the array that one time but then navigation between pages is instant after that which is much better.
I plan to do queries in places to see if any menu items have been changed and if so re-download and sort the menu.
So far in my testing the app seems to remember the info in the array just fine throughout the day with normal unrelated phone usage but there has to be some limits to that right?
ios - iOS - 从解析 currentUser 中检索图片
我正在使用 Parse.com 作为我的 iOS 应用程序的后端。
我有一个名为“用户”的类。在这堂课中,我有一张名为“图片”的用户头像。
目前我有点坚持如何为我的 currentUser 获取这张图片并将其显示在我的故事板视图控制器中的 UIView(而不是 UIImage)中。
也许你们有一些示例代码?
提前致谢!
ios - 使用 segue 信息 Parse.com 在 PFQueryTableViewController 中加载查询
我一直在寻找这个,但没有找到任何关于它的东西。我想PFQueryTableViewController
使用ViewController
. 问题是程序加载Query
之前获取有关segue的信息,因此Query
每次都会导致空搜索。
那是我的第一集ViewController
:
这是我Query
在下一个视图中的,即PFQueryTableViewController
:
如何在程序构建查询以安装表之前加载 segue?
PS。我已经尝试过perfomseguewithidentifier
在DidselectrowatindexPath
方法中做一个,但我认为问题不在于我如何发送信息,而在于我检索它的时间
ios - 我的解析查询直到应用程序的其余部分完成后才完成,我该如何阻止这种情况发生?
下面是解析查询,我试图在集合视图中显示类别,但该numberOfItemsInSection
方法运行之前getCategories
有时间从解析中提取信息。numberOfItemsInSection
用于getCategories _anArrayOfCategories
返回集合视图中的类别数。
有什么建议么?
objective-c - Parse.com - 编写关系查询?
几天来,我一直试图通过研究和研究文档来解决这个问题,但我无法理解/我不明白。
这是我想要实现的目标:
我有一个名为“ProfilePhotos”的自定义类和一个标准的用户类。当我将图像转储到名为“profilePicture”的列中的主用户类时,我有一些“工作”的代码。我需要从 ProfilePhotos 类中的“imageFile”获取图像。
我可以弄清楚如何将图像创建到一个类(ProfilePhotos)中,但是在从图像所属的用户(“名称”字段)收集数据时无法弄清楚如何调用它们。
我拥有的代码有效,但有一些奇怪的错误(图像以错误的顺序加载,根本没有,崩溃)如下:
ios - PFQueryTableViewController 两个section 有两个dataSource
我想有PFQueryTableViewController
两个部分:
- 第 1 部分:显示
PFObjects
查询的(通讯录中正在使用应用程序的联系人) - 第 2 部分:显示数组的对象(地址簿中所有联系人的列表)
目前我正在设置部分的数量:
我正在设置每个部分的行数:
当我尝试显示单元格的内容时,滚动时出现崩溃:
我收到错误消息:[__NSArrayM objectAtIndex:]: index 2 beyond bounds [0 .. 1]
原因一定是因为PFObject
第 1 节和第 2 节的每一行都被查询,并且由于第 2 节中有更多对象,它会在滚动时自动越界并崩溃。
在 a中显示两个带有两个dataSource
s 的部分的最佳方法是PFQueryTableViewController
什么?我必须在 a 中嵌入PFQueryTableViewController
aUITableViewController
吗?
ios - PFQuery 将存储在 PFObject 中的数组中的对象加载到 PFQueryTableViewController
我有一个PFQueryTableViewController
加载Thread
s (PFObjects 与关于论坛线程的数据)就好了。
当按下一个单元格时,PFQuertyTableViewController
会加载一个新Response
的 s(PFObjects 包含有关用户在线程上的响应的数据),但我无法确保它们是Response
特定于那个的Thread
。
我可以很容易地得到所有的响应,
但是,我不知道如何将它与 a PFQuery
in a一起使用PFQueryTableViewController
。这是我尝试过的:
我从这个论坛帖子中得到了这个想法,但它对我没有任何作用(self.objects 是空的)。
输出:
ios - Parse.com 获取附近的用户
我需要使用我的应用获取最近的 15 个用户的列表。当前用户的当前位置是这样存储的:
现在我想通过 PFQuery 检索附近的用户,如下所示:
不幸的是,它不起作用。我的数组似乎没有条目。有人可以为我澄清一下,如何以正确的方式使用查询?
干杯,大卫
(也发布在:https ://www.parse.com/questions/pfquery-to-retrieve-users-nearby )