2

I have two classes person and address. These two classes are subclassed from PFObject. How can I make a relation between these classes? Below is the code:

Person:
@interface Person : PFObject<PFSubclassing>
@property(strong,nonatomic)NSString *lastName;

Address:
@interface Address : PFObject<PFSubclassing>
@property(strong,nonatomic)Person *person;
@property(strong,nonatomic)NSString *lastName;

In Address file, I have done this to make a relation but it shows me null value: Both of them are created as singleton because I wanted to make relations.

address.person.lastName= person.lastName;

Please help me how to make the relation. Any help is appreciated. Thanks.

Pra Do
  • 293
  • 2
  • 3
  • 10
  • What happens if you do something like this? PFObject *comment = [PFObject objectWithClassName:kPAPActivityClassKey]; [comment setObject:trimmedComment forKey:kPAPActivityContentKey]; // Set comment text [comment setObject:[self.photo objectForKey:kPAPPhotoUserKey] forKey:kPAPActivityToUserKey]; // Set toUser [comment setObject:[PFUser currentUser] forKey:kPAPActivityFromUserKey]; // Set fromUser [comment setObject:kPAPActivityTypeComment forKey:kPAPActivityTypeKey]; [comment setObject:self.photo forKey:kPAPActivityPhotoKey]; – Henry Situ Oct 31 '15 at 19:05

0 Answers0