Reputation:
I'm building an application with parse. When logging in it pulls user data from the User class. Involved in this are two pointer fields that point to other entries in different classes.
I would like to extract the objectId's saved in these pointer fields and save them locally. I'm currently having issues with just extracting the objectId however.
Currently I use the line of code:
NSSString *clubObjectIdFind = [user objectForKey:(@"club")];
Where club is the pointer column concerned
However this returns: 'Club: 0x7fa6149288a0, objectId: H0XLN2krKS, localId: (null)'
As opposed to just: 'H0XLN2krKS' which is what I would like.
It's likely a very simple question, but is there any way of doing this?
Upvotes: 0
Views: 454
Reputation: 12260
It returns you object from Pointer already.
Use objectId
to reference or fetch this object later:
PFObject* object = (PFObject*)[user objectForKey:@"club"];
NSString* objectId = object.objectId;
Upvotes: 0
Reputation: 1423
Try using:
NSSString *clubObjectIdFind = [[user objectForKey:(@"club")]objectForKey:@"objectId"];
Upvotes: 1