Closed
Description
- Using LocalDataStore
- Subclass of PFObject is defined like this:
//PList.h
@interface PList : PFObject<PFSubclassing>
+ (NSString *)parseClassName;
@property (retain) NSString *name;
@property (retain) PFRelation *notes;
@end
//PList.m
@implementation PList
@dynamic name;
@synthesize notes = _notes;
+ (void)load {
[self registerSubclass];
}
+ (NSString *)parseClassName {
return @"PList";
}
- (PFRelation *)notes{
if(_notes == nil) {
_notes = [self relationForKey:@"notes"];
}
return _notes;
}
- (void)setNotes:(PFRelation *)notes{
_notes = notes;
}
@end
//----------
Used in code like this:
PNote *note = [PNote Object];
note.name = @"mynote";
PList list = ....
PFRelation *relation = [list notes];
[relation addObject:note];
[list saveInBackground];
Adding one 'note'-object goes without problems, I can see the object appearing on the dashboard. But when adding a second 'note' object an exception is thrown: [NSException raise:NSInternalInconsistencyException format:@"Operation is invalid after previous operation."];
-> object in relation is not added
Metadata
Metadata
Assignees
Labels
No labels