When I create an object from restkit with a null property, the application crashes, saying:
The value or default value specified for the 'secondHeader' property in 'FZPublication'
but the defaultPropertyValues method has a default value for the property
+(NSDictionary *)defaultPropertyValues {
return @{
@"serviceId" : @0,
@"filterId" : @0,
@"proccessDate" : @"",
@"relation" : @"",
@"header" : @"",
@"text" : @"",
@"remoteId" : @0,
@"versionId" : @0,
@"footer" : @"",
@"secondHeader" : @"",
@"companyRemoteId" : @0,
};
}
My restkit mapping:
RKObjectMapping *mapping = [RKObjectMapping mappingForClass:[FZPublication class]];
[mapping addAttributeMappingsFromDictionary:@{
@"IdServico":@"serviceId",
@"IdFiltro":@"filterId",
@"Lido":@"read",
@"DtProcessamento":@"proccessDate",
@"Relacao":@"relation",
@"Cabecalho1":@"header",
@"Cabecalho2":@"secondHeader",
@"Texto":@"text",
@"Id":@"remoteId",
@"IdEmpresa":@"companyRemoteId",
@"IdVersao":@"versionId",
@"DtPublicacao":@"publicationDateString",
@"NomeDiario" : @"diaryName",
@"DtDisponibilizacao" : @"availableDateString",
@"NDiario" : @"diaryNumber",
@"NProcesso" : @"proccessNumber",
@"NPagina" : @"pageNumber",
@"Rodape" : @"footer"
}];
Anyone have an idea what is going on?