When I tried to get records from the local data store in iOS, objects are returning but if I access a custom property it gives an error "-[PFObject name]: unrecognized selector sent to instance". Below is a sample code snippet.
PFQuery *query = [PFQuery queryWithClassName:@"GameScore"];
[query fromPinWithName:@"MyChanges"];
[[query findInBackground] continueWithBlock:^id(BFTask *task) {
NSArray *scores = task.result;
for (GameScore *score in scores) {
NSLog(@"score is : %d %d", score.highScore, score.name);
}
}];
and my subclass is like
@interface GameScore : PFObject <PFSubclassing>
@property (nonatomic, strong) NSString *name;
@property (nonatomic, strong) NSNumber *highScore;
@end
And I am saving them as
[query findObjectsInBackgroundWithBlock:^(NSArray *objects, NSError *error){
[GameScore pinAllInBackground:objects withName:@"MyChanges" block:^(BOOL succeeded, NSError *error) {
}];
}];
I had exact same issue as you, asked & answered it in this question: Parse local datastore and PFObject subclasses
Simply make sure you register your subclasses before doing anything else with Parse framework.