I getting this error "PFObject values may not have class: PFFile" when I try to save a image on a Parse object...
This is the code and the Object:
NSString *path = [[NSBundle mainBundle] pathForResource:@"GGB" ofType:@"jpg"];
NSData *d = [NSData dataWithContentsOfFile:path];
PFFile *f = [PFFile fileWithName:[NSString stringWithFormat:@"f_%d_%d.jpg",ctIdx,chIdx] data:d];
GPChallenge *ch = GPChallenge.object;
ch.name = [NSString stringWithFormat:@"Challenge %d.%d",(chIdx+1),(ctIdx+1)];
ch.category = cat;
ch.image = f;
[f save];
[ch save];
-- GPChallenge.h
#import <Parse/Parse.h>
@class GPCategory;
@interface GPChallenge : PFObject<PFSubclassing>
+ (NSString *)parseClassName;
@property NSString *name;
@property GPCategory *category;
@property PFFile *image;
@end
-- GPChallenge.m
#import "GPChallenge.h"
#import <Parse/PFObject+Subclass.h>
@implementation GPChallenge
@dynamic name;
@dynamic category;
@dynamic image;
+(void)load {
[self registerSubclass];
}
+ (NSString *)parseClassName {
return @"Challenge";
}
@end
Any idea?