JSON을 RestKit 응용 프로그램에 매핑하는 데 어려움이 있습니다. 코어 데이터에도 저장하고 싶습니다. 따라서 이미지에 대한 두 개의 링크가 있습니다. 첫 번째 이미지, 내 JSON의 모습.Restkit에서 JSON을 어려운 시간에 매핑
두 번째 이미지는 내 핵심 데이터베이스가 보이는 방법이다.
이제 제 I은 코어 데이터 층없이 적용했다. 따라서 데이터를 읽고 작업하십시오. 그 시점에서 모든 것이 효과가있었습니다. 그러나 핵심 데이터를 가지고 이와 같은 매핑 오류가 발생했습니다.LOG는
2013-01-10 10:46:02.663 Offitel2[27978:6813] D restkit.object_mapping:RKMappingOperation.m:635 Did not find mappable relationship value keyPath 'Person'
2013-01-10 10:46:02.664 Offitel2[27978:6813] D restkit.object_mapping:RKMappingOperation.m:635 Did not find mappable relationship value keyPath 'Function'
2013-01-10 10:46:02.664 Offitel2[27978:6813] D restkit.object_mapping:RKMappingOperation.m:635 Did not find mappable relationship value keyPath 'Department'
2013-01-10 10:46:02.665 Offitel2[27978:6813] D restkit.object_mapping:RKMappingOperation.m:635 Did not find mappable relationship value keyPath 'Company'
2013-01-10 10:46:02.672 Offitel2[27978:164f] W restkit.core_data:RKManagedObjectRequestOperation.m:555 Caught undefined key exception for keyPath 'user' in mapping result: This likely indicates an ambiguous keyPath is used across response descriptor or dynamic mappings.
2013-01-10 10:46:02.673 Offitel2[27978:164f] W restkit.core_data:RKManagedObjectRequestOperation.m:555 Caught undefined key exception for keyPath 'function' in mapping result: This likely indicates an ambiguous keyPath is used across response descriptor or dynamic mappings.
2013-01-10 10:46:02.674 Offitel2[27978:164f] W restkit.core_data:RKManagedObjectRequestOperation.m:555 Caught undefined key exception for keyPath 'department' in mapping result: This likely indicates an ambiguous keyPath is used across response descriptor or dynamic mappings.
2013-01-10 10:46:02.676 Offitel2[27978:164f] W restkit.core_data:RKManagedObjectRequestOperation.m:555 Caught undefined key exception for keyPath 'company' in mapping result: This likely indicates an ambiguous keyPath is used across response descriptor or dynamic mappings.
이것은 내가 코드에서 나의 관계 매핑을 수행하는 방법이다.
RKRelationshipMapping* relationUserMapping = [RKRelationshipMapping relationshipMappingFromKeyPath:@"Person"toKeyPath:@"user"withMapping:personMapping];
RKRelationshipMapping* relationFunctionMapping = [RKRelationshipMapping relationshipMappingFromKeyPath:@"Function"toKeyPath:@"function"withMapping:functionMapping];
RKRelationshipMapping* relationDepartmentMapping = [RKRelationshipMapping relationshipMappingFromKeyPath:@"Department"toKeyPath:@"department"withMapping:departmentMapping];
RKRelationshipMapping* relationCompanyMapping = [RKRelationshipMapping relationshipMappingFromKeyPath:@"Company"toKeyPath:@"company"withMapping:companyMapping];
NSLog(@"till here7");
[dataMapping addPropertyMapping:relationUserMapping];
[dataMapping addPropertyMapping:relationFunctionMapping];
[dataMapping addPropertyMapping:relationDepartmentMapping];
[dataMapping addPropertyMapping:relationCompanyMapping];
아무도 도와 주실 수 없습니까? 나는 핵심 데이터의 매핑에 대해 며칠 동안 고민하고있다.
감사합니다.