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 objectWithClassName:@"stuff"];
item[@"Name"] = @"PS3";
PFObject *girl = [PFObject objectWithClassName:@"girlBio"];
girl[@"Name"] = @"Jessica";
PFObject *girl2 = [PFObject objectWithClassName:@"girlBio"];
girl2[@"Name"] = @"Cindy";
PFRelation *relation = [item relationForKey:@"owners"];
[relation addObject:girl];
[relation addObject:girl2];
[item saveInBackground];
--------------------------------- update also tried this -------------------------
PFObject *item = [PFObject objectWithClassName:@"stuff"];
item[@"Name"] = @"PS3";
PFObject *girl = [PFObject objectWithClassName:@"girlBio"];
girl[@"Name"] = @"Jessica";
[item saveInBackground];
[girl saveInBackground];
PFRelation *relation = [item relationForKey:@"owners"];
[relation addObject:girl];
[item saveInBackground];
So I want this item to be owned by several girls however when I run the program I get this error:
Error: can't add a non-pointer to a relation (Code: 111, Version: 1.6.0)
Can someone help please?
Thank you