I get a JSON response like this
{ "id" : 12345 "course_name" : "history", "teacher" : "joy", "region" : { "code" : "Al", "name" : "Alabama" } }
I have a course object in coredata and a corresponding model in code like "MKCourse", this object is similar to this
MKCourse - id - courseName - teacher - regionCode - regionName
I am setting values ββfrom a nested dictionary in MKCourse, like this:
mapping = [RKManagedObjectMapping mappingForClass:[self class] inManagedObjectStore:[[RKObjectManager sharedManager] objectStore]]; mapping.setDefaultValueForMissingAttributes = YES; mapping.setNilForMissingRelationships = YES; [mapping mapKeyPathsToAttributes: @"id", [self modelIdAttribute], @"course_name", @"courseName", @"teacher", @"teacher", @"region.code", @"regionCode", @"region.name", @"regionName", nil];
But it always sets nil to regionCode and regionName. I do not know what is wrong. Is it possible to get such values.
source share