i've managed manually map json string managed object, can't find how have result object inserted managed object context of choice. have create instance of rkobjectmanager ?
nsmutabledictionary *area = [nsmutabledictionary dictionarywithobject:dictionary forkey:@"restricted_position_detail"]; nsstring* jsonstring = [[dataprovidermanager sharedmanager] getjsonstringfromobject:area]; nsstring* mimetype = @"application/json"; nserror* error = nil; id<rkparser> parser = [[rkparserregistry sharedregistry] parserformimetype:mimetype]; id parseddata = [parser objectfromstring:jsonstring error:&error]; if (parseddata == nil && error) { dlog(@"%@",error); } rkobjectmappingprovider* mappingprovider = [rkobjectmanager sharedmanager].mappingprovider; [mappingprovider setmapping:[self getobjectmapping] forkeypath:@"restricted_position_detail"]; rkobjectmapper* mapper = [rkobjectmapper mapperwithobject:parseddata mappingprovider:mappingprovider]; rkobjectmappingresult* result = [mapper performmapping]; if (result) { dlog(@"yay! mapping finished successfully"); } else{ dlog(@"yay! mapping failed"); }
finally had setting rkobjectmapper instance targetobject property object created in moc !
Comments
Post a Comment