Questions tagged [pfrelation]

A class that is used to access all of the children of a many-to-many relationship as it pertains to a specific PFObject. Each instance of PFRelation is associated with a particular parent object and key.

More information available here.

64 questions
10
votes
3 answers

Declare a read-only @NSManaged property in Swift for Parse's PFRelation

I'm using Parse object store in my iOS application and I've created a custom subclass for my Parse object, which looks somewhat like this: class MyThing: PFObject, PFSubclassing { // ...PFSubclassing protocol... @NSManaged var name: String …
Arnold
  • 2,390
  • 1
  • 26
  • 45
7
votes
1 answer

'Cannot do a comparison query for type: PFRelation' Swift

I am trying to query for all of the existing users in my app that the user has not added as a "Friend". I am getting the error Cannot do a comparison query for type: PFRelation Here is my current code: override func queryForTable() -> PFQuery…
Trip Phillips
  • 430
  • 1
  • 5
  • 18
6
votes
1 answer

Error adding objects to a PFRelation, how is this done?

I am trying to get my head around PFRelation in parse. I have a class called "girlBio" that stores information about girls and a class called "stuff" that stores information about items. code below: PFObject *item = [PFObject…
Kex
  • 8,023
  • 9
  • 56
  • 129
5
votes
1 answer

Parse: Issue with PFRelation and local datastore

I'm building a chat application with Parse. I have a class "Conversation" and a class "Message". A Conversation can have many messages (one-to-many) relationship. Also, I'm using the local datastore to cache the objects (both Conversation and…
4
votes
3 answers

Why PFRelation does not support fromLocalDataStore queries?

I have a PFUser object with several PFRelation pointing to other objects. When I run the following code: PFRelation *relation = [[PFUser currentUser] relationForKey:@"Relation"]; PFQuery *query = [relation query]; [query…
Alexander Vasenin
  • 11,437
  • 4
  • 42
  • 70
3
votes
2 answers

Should I use an array of pointers or a PFRelation? (parse.com)

As far as I can tell, the only reason you might use an array of pointers is to preserve ordering, as a PFRelation instance does not support ordering. Otherwise, they appear to behave identically, albeit PFRelation is more scalable and also has a…
max_jf5
  • 169
  • 1
  • 12
2
votes
1 answer

Create PFQuery for PFRelation with zero objects

I want to create a PFQuery for a PFRelation to find objects where the specified relation has zero objects in it. Here's what I've tried: PFQuery *categoryQuery = [CatalogCategory query]; [categoryQuery whereKeyDoesNotExist:@"subcategories"]; But I…
Cory Imdieke
  • 14,140
  • 8
  • 36
  • 46
2
votes
1 answer

Save current user's message list in parse with swift

I use parse for my app. I want to let user able to type messages that they want to send via textField and save it to that user's messages column in parse with PFRelation via save button in view controller and the messages will be saved as an array…
sin90
  • 171
  • 1
  • 12
2
votes
0 answers

PFInstallation app first launch issue

i have a serious bug that happens only at first install/launch of my Application. The situation is this: i have a one-to-many relation on my PFInstallation object and i use the query associated with this relation to get all "user's" objects. This is…
Dodgson86
  • 333
  • 1
  • 4
  • 15
2
votes
1 answer

Swift : How to get Inverse relationship in Parse.com

I have a class of users in Parse named "User". I set a PFRelation of user with other users like this : let relation : PFRelation = currentUser.relationForKey("KfriendsRelation") Lets say i have user 1, i can retrieve all users that this…
jmcastel
  • 1,365
  • 7
  • 17
  • 34
2
votes
1 answer

Parse: How do I query using PFRelation when I just have PFUser?

Here is an example of what I am trying to do. I have the current user as PFUser and on another class named Item I have a relation named "owners" which is a relation of PFUser. I want to query for all instances of Item which have the current user in…
Brennan
  • 11,546
  • 16
  • 64
  • 86
1
vote
1 answer

Crashing on addObject/removeObject with PFRelation after migrating to heroku

After migrating to heroku, my code is crashing when adding a PFUser to a PFRelation. This code was working fine when hosted on Parse. func blockUser(user : PFUser) -> Void { PFUser.currentUser()?.relationForKey("blocked").addObject(user) …
kokernutz
  • 268
  • 3
  • 9
1
vote
1 answer

Two constraints on one key in a Parse Query

I'm using Parse and my app is written in Swift. I have a golf app that allows a user to friend other users. The users can log their golf scores and then see their golf scores and their friend's scores in a leaderboard style tableViewController. The…
dcotter
  • 312
  • 6
  • 22
1
vote
2 answers

save current user to relation in parse with swift

I have a system where when the current user accepts a request my app adds a relation between the user that sent the request to the current user. However I want to also have the current user added to the other user's relation so that it is not just…
kareem
  • 903
  • 1
  • 14
  • 36
1
vote
1 answer

How to get query.whereKey(key, containedIn: [Array]) to work with relation.query

I am querying both the local data store and the server for PFObjects. To try and save mobile data usage and networking usage, the data is first looked up in the local data store and then whatever has not been found is looked up on the server. The…
Acoop
  • 2,586
  • 2
  • 23
  • 39
1
2 3 4 5