I have subclassed PFuser and registered it. it works great.
In my database in the User table i made a pointer to another table that has some more information.
the app keeps crashing with this error:
2014-06-08 15:14:59.550 App[2333:60b] *** Terminating app due to uncaught exception
'NSInternalInconsistencyException',
reason: 'Key "place" has no data. Call fetchIfNeeded
before getting its value.'
While checking the debugger i can see it made the connection to another table but all fields are empty.
I think i need to put something like this: [query includeKey:@"company"];
for the pointer but I don't do a query for the User class...
do I need to override it somewhere ?
this is my custom user class:
-h file
#import "Company.h"
@interface PFCustomUser : PFUser<PFSubclassing>
@property (nonatomic, retain) NSString *name;
@property (nonatomic, retain) UIImage *userPhoto;
@property (nonatomic, retain) Company *company;
+ (PFCustomUser *)currentUser;
-m file
#import "PFCustomUser.h"
@implementation PFCustomUser
@dynamic name,userPhoto,company;
+ (PFCustomUser *)currentUser {
return (PFCustomUser *)[PFUser currentUser];
}
In the appdelegate i do this
[PFCustomUser registerSubclass];
So technacly i would do this in a controller
PFCustomUser *currentUser = [PFCustomUser currentUser];
NSLog(@"%@",currentUser.company.place);
company is nill so place is nill. hence the error.. In the debugger you can see it sees the objectId of company and the classname but the rest is nill