Closed marcaoas closed 9 years ago
@marcaoas could you please share the code in which you're creating your object?
Having the same problem.
It's a Restkit request and the object is created from restkit
RKObjectManager *manager = [RKObjectManager sharedManager];
[manager getObjectsAtPath:kProccessProgressPath parameters:params success:^(RKObjectRequestOperation *operation, RKMappingResult *mappingResult) {
if([mappingResult array].count == 0){
[self finish];
} else {
NSNumber *lastVersion = @0;
RLMRealm *realm = [RLMRealm defaultRealm];
[realm beginWriteTransaction];
for(FZProccessProgress *progress in [mappingResult array]){
FZProccessProgress *pp = [FZProccessProgress objectForPrimaryKey:[NSNumber numberWithInt:progress.remoteId]];
if(!pp){
progress.read = NO;
} else {
progress.read = pp.read;
}
[realm addOrUpdateObject:progress];
if([NSNumber numberWithInteger:progress.versionId] > lastVersion){
lastVersion = [NSNumber numberWithInteger:progress.versionId];
}
}
[realm commitWriteTransaction];
[self syncWithVersion:lastVersion];
}
} failure:^(RKObjectRequestOperation *operation, NSError *error) {
//TODO
NSLog(@"%@", error);
[self error];
}];
@marcaoas, I've seen this issue with RestKit usage a few times, and every time it's been related to NSNull
values getting into the RestKit-mapped object. Can you check if this is indeed what is happening? I'm considering adding an option in RestKit to not map null values, which would help in that circumstance.
@marcaoas, it would also be incredibly helpful to have an example project that replicates the issue.
Ok @segiddins I'll create an example project.
@marcaoas did you end up creating an example project I could have a look at?
@marcaoas feel free to ping me to reopen this issue if you get together an example project.
Hi. I have the following defaultPropertyValues method:
And when I save the object the following exception is thrown:
Am I doing something wrong or it is a bug?