I've had a smooth time with Parse until this point. I'm currently having a snippet of code below.
// Retrieve all ride requests
PFQuery *query = [RideRequest query];
[query includeKey:@"customer"];
[query whereKey:@"status" equalTo:@(RIDE_REQUESTED)];
[query orderByDescending:@"numberOfPeople"];
[query findObjectsInBackgroundWithBlock:^(NSArray *objects, NSError *error) {
rides = objects;
}];
The block above is never entered as I receive the following error Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'Key "numberOfPeople" has no data. Call fetchIfNeeded before getting its value.'
RideRequest is a registered subclass. The class interface is what you see below in its basic form.
@class User
@interface RideRequest : PFObject<PFSubclassing>
@property (nonatomic, strong) User *customer;
@property (nonatomic) int status;
@property (nonatomic, strong) NSString *numberOfPeople;
User is a registered subclass of PFUser.
@class RideRequest
@interface User : PFUser<PFSubclassing>
@property (nonatomic, strong) RideRequest *rideRequest;
I have other subclassed pfobjects that don't have any problem performing a PFQuery however none of those have a reference to User (the subclass of PFUser). I'm assuming that it may be related to why I'm seeing this issue. I'm not sure why the key 'numberOfPeople' is being called out as needing to be fetched. It is not a pointer to a PFObject. So it's a bit confusing. Any help would be greatly appreciated.