0

I'm using PFObject subclassing, say:

@interface CarObject : PFObject <PFSubclassing>
@property (nonatomic, strong) BrandObject *brand;
@end

and

@interface  BrandObject : PFObject <PFSubclassing>
@end

How can I create CarObject with a reference to respective BrandObject without creating or fetching the BrandObject if I know BrandObject.objectId string?

Miroslav Kuťák
  • 1,875
  • 1
  • 18
  • 24

1 Answers1

1

You can create an empty placeholder object with a specified I'd by using objectWithoutDataWithClassName:objectId:.

Wain
  • 118,658
  • 15
  • 128
  • 151
  • I will accept after 2 min:) Could you please add how to perform this when initializing the CarObject with NSDictionary containing the BrandObject.objectId? – Miroslav Kuťák Dec 03 '15 at 20:11
  • 1
    You can add your own convenience method which takes that parameter and returns the instance – Wain Dec 03 '15 at 20:13