iosobjective-cparse-platformpfobjectpfsubclassing

PFObject subclass pointer assignment without prefetching the related PFObject


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?


Solution

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